I have a project with a Universal storyboard (screen size: 600 x 600) containing a class that overrides UITableViewCell
:
class MyTableCell: UITableViewCell
{
...
}
Rather than utilising a prototype cell, the UITableView
that displays this cell registers MyTableCell
as a class:
myTableView.registerClass( MyTableCell.self, forCellReuseIdentifier: "myCell" )
MyTableCell
then overrides layoutSubviews
:
override func layoutSubviews ()
{
super.layoutSubviews()
let width = CGRectGetWidth( frame )
}
Great! However, the width that is returned is the universal 600, and not the device-specific 320 that I need.
What am I doing wrong please? Thank you.