Trying to subclass UIButton but the error Must call a designated initializer of the superclass 'UIButton'
occurs.
Researching several SO posts like this, this, this, or several others did not help as those solutions didn't work.
How can we subclass UIButton
in Swift and define a custom init function?
import UIKit
class KeyboardButton : UIButton {
var letter = ""
var viewController:CustomViewController?
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
init(letter: String, viewController: CustomViewController) {
super.init()
...
}
}