For the impatient reader:
TL;DR
- The ErrorType protocol has hidden requirements that are automatically fullfilled if you use an enum to implement the protocol
- Objective-C methods can only be translated to Swift's error handling mechanism if they return Objective-C objects or boolean values
- Swift will invoke the catch block if the Objective-C method returns nil/false, independent of whether an NSError was produced or not
- If an Objective-C method produces an NSError and returns a value the catch blocks is not invoked and the error cannot be retrieved
Your new post is loading...