Chapter 20
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 own frameworks in Swift, but Apple has not rewritten 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 ...
Get Learn Swift 2 on the Mac, Second Edition 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.