Chapter    18

Interoperability with Objective-C

Swift is an awesome language and works great by itself, but when you’re writing iOS or OSX applications, you have to interface with the frameworks that Apple provides and perhaps with your own existing frameworks. You may be able to rewrite your frameworks in Swift, but Apple hasn’t provided its frameworks in Swift yet, if it ever will. Apple does provide interoperability with existing frameworks that use the Objective-C and C APIs.

Note  Interoperability in this case is the capability of interaction between the Swift and Objective-C APIs in either direction. This means being able to use the Swift API in Objective-C code and the Objective-C API in Swift code.

To use Swift in Objective-C or vice ...

Get Learn Swift on the Mac: For OS X and iOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.