Reputation: 1464
Is it possible to generate OS X and iOS binaries from one same swift source code file in Xcode 6? And if yes, how?
Upvotes: 4
Views: 672
Reputation: 126167
Yes. The way you share Swift code between multiple targets in a project is no different from how you share ObjC code.
For an example, see the new Lister app sample code in the developer library. That project builds an OS X app and an iOS app, and for each platform it builds the app, a Notification Center Today View extension, and a bundled framework supporting both.
Upvotes: 4
Reputation: 4004
Yes, definitely. See WWDC 2014 Session 233 (Friday 9 am) or check out the documentation on Xcode targets. (h/t uchuugaka)
Upvotes: 2