Changing the color of UITableView section headers

With UIAppearance you can change UILabel text color on your UITableView headers like this:

[[UILabel appearanceWhenContainedIn:[UITableViewHeaderFooterView class], nil] setTextColor:[UIColor whiteColor]];
[[UILabel appearanceWhenContainedIn:[UITableViewHeaderFooterView class], nil] setShadowColor:[UIColor whiteColor]];

Should work on iOS 6.0+. Can be called anywhere (viewDidLoad etc).


With the newer UIAppearance way of doing things, in versions > iOS 6.0 you can just do, for example:

[[UITableViewHeaderFooterView appearance] setTintColor:[UIColor redColor]];