You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to implement the cocoa pod, BWWalkthrough, into my current project programmatically, I ran into a problem with the init functions/inheritance.
I tried to subclass BWWalkThroughViewController in my own class GetStartedViewController where I define buttons and pagecontrollers.
Here is the code from BWWalkThroughViewController which is a subclass of UIViewController:
But when I try and subclass BWWalkthroughViewController in my own class I get errors saying "Ambiguous reference to member 'init(coder:)'" when calling super.init(nibName, bundle) and another error (Initializer does not override a designated initializer from its superclass) when I try to override the init(nibname, bundle):
import BWWalkthrough
class GetStartedViewController: BWWalkthroughViewController {
required public init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
public init(){
super.init(nibName: nil, bundle: nil) <== ERROR (Ambiguous reference to member 'init(coder:)')
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) <== ERROR (Initializer does not override a designated initializer from its superclass) {
super.init(nibName: nil, bundle: nil) <== ERROR (Ambiguous reference to member 'init(coder:)')
}
}
I've tried different variations of containing just the public init or just the override init and not both, so I included both to show the error.
Even when I use autocomplete to call super.init, all that shows up is the function with parameters of nscoder rather than with nibName and bundle.
Can someone please help me understand why this error is happening and how to fix it? I don't understand why I can't call super.init(nibName, bundle) or override the function.
Also, if anyone else has experience implementing BWWalkthrough programmatically and/or subclassing BWWalkthroughViewController without this init bug, any help would be appreciated :)
The text was updated successfully, but these errors were encountered:
While trying to implement the cocoa pod, BWWalkthrough, into my current project programmatically, I ran into a problem with the init functions/inheritance.
I tried to subclass BWWalkThroughViewController in my own class GetStartedViewController where I define buttons and pagecontrollers.
Here is the code from BWWalkThroughViewController which is a subclass of UIViewController:
But when I try and subclass BWWalkthroughViewController in my own class I get errors saying "Ambiguous reference to member 'init(coder:)'" when calling super.init(nibName, bundle) and another error (Initializer does not override a designated initializer from its superclass) when I try to override the init(nibname, bundle):
I've tried different variations of containing just the public init or just the override init and not both, so I included both to show the error.
Even when I use autocomplete to call super.init, all that shows up is the function with parameters of nscoder rather than with nibName and bundle.
Can someone please help me understand why this error is happening and how to fix it? I don't understand why I can't call super.init(nibName, bundle) or override the function.
Also, if anyone else has experience implementing BWWalkthrough programmatically and/or subclassing BWWalkthroughViewController without this init bug, any help would be appreciated :)
The text was updated successfully, but these errors were encountered: