To use the SDK with CocoaPods, add the following lines to your Podfile:
use_frameworks! pod 'FacebookCore' pod 'FacebookLogin' pod 'FacebookShare'
Each of these dependencies can be used independently. Exclude any that you don't need.
To use the SDK with Carthage, add the following line to your Cartfile:
After performing a
carthage install, add
FacebookShare.framework to your project, along with their Facebook SDK for iOS dependencies (
While not recommended, it is entirely possible for you to build the Facebook SDK for Swift outside of any dependency management system. Note that you will need to manage the process of updating this solution, as well as the dependencies is has on the Facebook SDK for iOS.
To compile the SDK manually, start by cloning the repository:
git clone https://github.com/facebook/facebook-sdk-swift.git # Once that's completed, you should initialize all submodules: cd FacebookSwift git submodule update --init --recursive
After you've initialized the repository, add the
FacebookSwift.xcodeproj as a sub-project to your application's project, and then add the
FacebookShare.framework build products from that subproject to your applications Link Frameworks and Libraries section, as well as your Embedded Binaries section. Don't forget to embed/link