Subclassing Example

suggest change

A private method is not visible to a subclass, so it cannot be overridden. The method needs an access level the subclass can see. internal is the default:

public class SuperClass {
    func secretMethod() {}
}

internal class SubClass: SuperClass {
    override func secretMethod() {
        super.secretMethod()
    }
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents