DanijelHuis / HDAugmentedReality

Augmented Reality component for iOS, written in Swift.
MIT License
480 stars 97 forks source link

Does this need to be public? #50

Closed gp-wang closed 7 years ago

gp-wang commented 7 years ago

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

DanijelHuis commented 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)
}
gp-wang commented 7 years ago

WOrks great now