Closed gp-wang closed 7 years ago
Sry, haven't really tested subclassing, I made it public in version 2.1.0. You can override initialize in your subclass, it is called only once after any init.
override func initialize()
{
}
or you can override inits like this:
override init()
{
super.init()
}
required public init?(coder aDecoder: NSCoder)
{
super.init(coder: aDecoder)
}
WOrks great now
I tried to subclass ARViewController.swift. Without public keyword, the subclass's init method seems to fall through to NSObject protocol.
(If I delete the subclass's init method, Xcode complains not using designated initializer in super class)
https://github.com/DanijelHuis/HDAugmentedReality/blob/aa469b49d5fc24ec7e370f575107a13c368c64b0/HDAugmentedReality/Classes/ARViewController.swift#L99