Question is fairly self explanatory and I may be missing something simple. The following is done in Interface Builder.
I have created a UITableViewController, I've set the Content to Static Cells
and Style to Grouped
.
I've defined the number of Sections as well as the number of Rows for each section. I've set the Style of each cell to be Basic
.
Now, within each cell, I have the default Content view and Label. For the label I have set the Text to Plain
, Font to Body
and Lines to 0
. Normally this allows me to achieve Dynamic Type with UILabels.
I hook up the cells as IBOutlets and set their text (only) programmatically.
When I run the app, everything is there, except that the Font of the labels (as well as the height of each cell) is unchanged (not Dynamic Type).
Therefore, my question is, can Dynamic Type be achieved for a label within a Basic
(non Custom
) Static Cell or are these cells meant to be "as they are"?
The closest question I've seen on SO is this, however it refers to Custom
Cells.
Also tried implementing
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.rowHeight = UITableViewAutomaticDimension
}
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
but to no avail.