How to Link to a 3Rd Party Swift Framework

How do I link to a 3rd party Swift framework

Ok, not many users are familiar with Swift frameworks yet, I guess.

Well, I'm getting some assistance from a framework developer over on an issue I raised on how to consumer their framework. I still have issues, but others may be interested in following the conversation to see some of the steps involved

https://github.com/typelift/swiftz/issues/114

Detailed instructions are provided at this issue. Feel free to try them. I'll mark this as closed.

UPDATE
I stated this in a comment but it might not be seen. I was trying to write a command line tool. At this time with XCode 6.1 it does not appear possible to use a third party framework in a command line tool. As a matter of fact I've written up an issue against another project stating that their command line targets no longer run: https://github.com/railsware/Sleipnir/issues/17

Perhaps this worked in a previous beta version, but it no longer seems possible.

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?

Xcode links a Third Party framework in my Framework and includes it's symbols

I wasn’t able to achieve this behavior building dynamic frameworks. However, as I built my framework as static, the framework compiled fine and did not include third party framework symbols. All the linking with the third party framework has to be done on the app level.

I have seen many questions on stack overflow like this with no definite answer. I hope my finding would help.



Related Topics



Leave a reply



Submit