Monday, July 24, 2017 [Tweets] [Favorites]

Matching and Bridging NSErrors in Swift

Joshua Emmons:

You can find all the gory details in SE-0112, but the long and the short of it is, depending on the domain of a given NSError, Swift automatically bridges it to a struct describing that domain. In the case of NSURLErrorDomain, for example, Swift will bridge to a URLError[…]

You can also use the CustomNSError protocol to bridge in the other direction.

See also: CocoaError.

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment