I want to implement some NSNotificationCenter selector method in protocol extension. The reason is extensibility some mechanism for few ViewControllers. But this doesn't work. I have error: unrecognized selector.
Ok, I make some test like this:
protocol SomeProtocol{
func xyz()->Void
}
class BigData : NSObject, SomeProtocol{
func xyz() {
/
}
}
let big = BigData()
big.respondsToSelector("xyz")
It works fine - respondsToSelector() returns true, but if I write the code in protocol extension:
extension SomeProtocol{
func xyz(){
}
}
then respondsToSelector() return false. My question is: why? How can I fix this? I really need this mechanism.