I'm trying to subclass a UITableViewCell in Swift.
I've tried this:
class CUISwitchTableViewCell: UITableViewCell {
var label = UILabel()
var switchControl = UISwitch()
init(coder aDecoder: NSCoder!) {
super.init(coder: aDecoder)
// Set up UI
}
}
But I get a compiler error when calling super.init(coder: aDecoder):
Must call a designated initializer of the superclass 'UITableViewCell'
So what I understand is that I must call init(style: UITableViewCellStyle, reuseIdentifier: String!), but then I will lose all the setups made in Interface Builder. If I not overriding initWithCoder where should I set up my views?