There are two problems:
- Swift 2 maps
func doSomething() throws to the Objective-C method - (BOOL) doSomethingAndReturnError: (NSError **)error; that is different from your protocol. - The protocol method should be marked as "Objective-C compatible" with the
@objc attribute.
There are two possible solutions:
Solution 1: Rename the Objective-C protocol method to
@protocol SomeObjCProtocol - (BOOL) doSomethingAndReturnError: (NSError **)error; @end
Solution 2: Leave the Objective-C protocol method as it is, and specify the Objective-C mapping for the Swift method explicitly:
@objc(doSomethingWithError:) func doSomething() throws {
source share