As part of a task at work, I ended up having to figure out all of the default fonts for UITableViewCell and UITableViewHeaderFooterView. I've documented them below, since Apple has not. These values are from iOS 11, and may change as part of a future OS release.
UITableViewCell
There are several font text styles used in the pre-defined styles of UITableViewCell. Pass these styles to +[UIFont preferredFontForTextStyle:]
to retrieve the font.
Cell Style | Label | Font Style | Text Color |
---|---|---|---|
UITableViewCellStyleDefault | textLabel | UIFontTextStyleBody | Black |
UITableViewCellStyleValue1 | textLabel | UIFontTextStyleBody | Black |
detailTextLabel | UIFontTextStyleBody | Gray R: 0.5, G: 0.5, B: 0.5 | |
UITableViewCellStyleValue2 | textLabel | UIFontTextStyleFootnote | Blue R: 0.22, G: 0.33, B: 0.53 |
detailTextLabel | UIFontTextStyleFootnote | Black | |
UITableViewCellStyleSubtitle | textLabel | UIFontTextStyleBody | Black |
detailTextLabel | UIFontTextStyleCaption1 | Black |
UITableViewHeaderFooterView
The font style of UITableViewHeaderFooterView
's labels depends on the style of the table view they are added to.
Table View Style | Label | Font Style | Text Color |
---|---|---|---|
UITableViewStylePlain | textLabel | UIFontTextStyleBody | Gray R: 0.42, G: 0.42, B: 0.44 |
UITableViewStyleGrouped | textLabel | UIFontTextStyleFootnote | Gray R: 0.42, G: 0.42, B: 0.44 |
detailTextLabel | UIFontTextStyleFootnote | Gray R: 0.42, G: 0.42, B: 0.44 |