Closed bryanbartow closed 8 years ago
@vtourraine?
I’m not very familiar with Swift (yet), so I don’t really know how to solve this situation.
If you just need to customize the cells, you shouldn’t need to touch the controller initializers. When does this error occur exactly (compile, run time, where)?
@vtourraine The error is at compile time. I'd rather not touch the initializers, but Swift requires the subclass to implement them.
Alright. Have you tried with the initializers from AcknowListViewController
? It already has to override a couple of initializers from its superclass.
@vtourraine Yes, I've tried with and without those initializers.
Got this to compile:
class CustomAcknowListViewController: AcknowListViewController {
required convenience init(coder aDecoder: NSCoder) {
self.init(acknowledgementsPlistPath: nil)
}
}
The current initializers configuration might be problematic for people using Storybards/XIBs. Room for improvements, as always.
@vtourraine That worked! I could swear I tried it already, but oh well. Thanks. I'll leave it up to you whether you want to close this ticket or not.
Great, happy to hear that.
I’ll close this issue, but it got me thinking about the initializers configuration (designated/convenience/etc), and I might change all that for a future version. If someone more comfortable with Swift than me can figure out a better solution, pull-requests are welcome.
I've been trying to subclass
AcknowListViewController
so I can customize the textLabel appearance in thecellForRowAtIndexPath
method. Unfortunately, I can't seem to get past themust call designated initializer method
error. I've tried calling / overriding every combination of init method I can think of. Is there any way to subclass this? I can't think of any other way to get to the table view cell.