Multi-Platform Projects

On the other hand, what if you have some great iOS code, and you’d like to bring it to the Mac? Well, you can just wait until 2019, when Apple brings UIKit to the Mac, right? Wrong! You can bring most of your code to the Mac without waiting for Apple to do the job for you by leveraging the power of Xcode targets.

To be clear, UIKit on iOS (and tvOS) and AppKit on macOS are two fairly different things. After all, they should be—iPhones don’t have windows or menu bars, and Macs don’t rotate or have touchscreens. But beneath those top-level UI frameworks, most of the underlying frameworks are the same: both have Foundation, Core Location, StoreKit, and other application-logic frameworks. In fact, both platforms’ UI frameworks ...

Get Xcode Treasures 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.