How to I Import 3Rd Party Frameworks into Xcode Playground

How to I import 3rd party frameworks into Xcode Playground?

Edited: As of Beta5 this is now supported when the playground is part of the workspace that builds the framework as a target. There are more details on the Apple dev forums site, but hopefully @Rick Ballard will add them to his answer here and that should becoke the definitive answer for this question.

Don't do the below anymore!


For the short term, while there's no supported solution, if you're producing a Module/Framework you can copy it into the SDKs System/Library/Frameworks directory and then just import <#Module#> the same way as you import system Frameworks.

For an OS X Playground: /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks

And for iOS: /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/System/Library/Frameworks/

But before you do that... go file a radar as @Rick says in his answer.

How to manually import third party Swift framework into Swift iOS project?

Your life will be a lot easier if you import the framework using CocoaPods. If you haven't used them before, it's really easy once you get set-up. You use Ruby Gems on the command line to install CocoaPods (sudo gem install cocoapods) and then create a create a pod file using pod init. After this you modify it to include:

platform :ios, '8.0'

use_frameworks!

pod 'OAuthSwift', '~> 0.5.0'

Save the file and run pod install.

Once this is complete you will have to close out the Xcode project and use the newly created .xcworkspace project file (not the .xcodeproj) from here forward.

Here is a link to another post for a secondary reference.
How to install cocoapods?

Import Parse Framework To Playground

Sample ImageIn Xcode 7 this has finally become very easy! Open a playground and save it in your projects root directory. Add the import statement and bing, bang, boom, you're done.

I'm using XCode 7.2



Related Topics



Leave a reply



Submit