swift3 - swift 3 override init does not override / cannot find overloads -
i can't seem extend class cocoapod ra1028/former in application right initializers parent class. why this?
see below situation divided code pod , application code (extendedformlabelheaderview class)
// ra1028/former cocaopod class signatures public protocol formableview: class {} public protocol labelformableview: formableview {} open class formheaderfooterview: uitableviewheaderfooterview { required public init?(coder adecoder: nscoder) { super.init(coder: adecoder) } override public init(reuseidentifier: string?) { super.init(reuseidentifier: reuseidentifier) } } open class formlabelheaderview: formheaderfooterview, labelformableview { required public init?(coder adecoder: nscoder) { super.init(coder: adecoder) } override public init(reuseidentifier: string?) { super.init(reuseidentifier: reuseidentifier) } } // app code open class extendedformlabelheaderview: formlabelheaderview { required public init?(coder adecoder: nscoder) { super.init(coder: adecoder) } override public init(reuseidentifier: string?) { super.init(reuseidentifier: reuseidentifier) } }
running above code in playground works.
but running setup in workspace (coming swift 2.2, converted swift 3) first complain extendedformlabelheaderview's override init(reuseidentifier: string?)
initializer not being public (most because cannot find initializer needs override?) , end these error messages:
initializer not override designated initializer superclass.
argument labels '(reuseidentifier:)' not match available overloads
some other things note:
- it worked in 2.2
- i updated former latest swift 3.0 version
- removing
override
keyword offending initializer in extendedformlabelheaderview class give different error first line:initializer 'init(reuseidentifier:)' objective-c selector initwithreuseidentifier:' conflicts implicit initializer 'init(reuseidentifier:)' superclass
Comments
Post a Comment