How to define optional methods in Swift protocol?
Is it possible in Swift? If not then is there a workaround to do it? 20 Answers 20
Is it possible in Swift? If not then is there a workaround to do it? 20 Answers 20
weak references don’t seem to work in Swift unless a protocol is declared as @objc, which I don’t want in a pure Swift app. This code gives a compile error (weak cannot be applied to non-class type MyClassDelegate): class MyClass { weak var delegate: MyClassDelegate? } protocol MyClassDelegate { } I need to prefix the … Read more