1

Just curious on how it works, why is it possible to override some functions from extensions but not others? E.g.

class SomeClass { }

extension UIViewController {
    func testFunction(bool: Bool) { }
    func someOtherFunction(someClass: SomeClass) { }
}

class testViewController: UIViewController {
    override func testFunction(bool: Bool) { }
    override func someOtherFunction(someClass: SomeClass) { }
}

In this case the FIRST one is fine, as it only contains a bool, but the SECOND one is not, since it takes my class object. So the second one will throw Declarations from extensions cannot be overriden yet, but that's obviously not true since I am doing it in the line above.

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.