Comment Comment by nottombrown Here's an implementation of the latter try operator in swift. extension Optional { func try<U>(f: (T) -> U) -> Optional<U> { if let unwrapped = self { return f(unwrapped) } else { return nil } } } You can see how to use it in this gist:https://gist.github.com/nottombrown/c6585cad9588a9dc5383 parent nottombrown 12 years ago
https://gist.github.com/nottombrown/c6585cad9588a9dc5383