Compile the Sample Project

This guide shows you how to compile the sample in the Facebook SDK for iOS Swift. The sample project demonstrates the following:

  • Facebook Login - authenticate people with their Facebook credentials.
  • Share and Send dialogs - Enable sharing content from your app to Facebook.
  • App Events - Understand your audience and the performance of your app.
  • Graph API - Read and write directly to the Facebook social graph.

You can download the Facebook SDK for Swift from GitHub. The sample project is in the facebook-swift-sdk/Samples/Catalog/ folder.

To compile the sample project

The project uses Carthage as the dependency manager.

  1. Clone or download the project to your computer.
  2. In a Terminal window, go to the folder with the project.
  3. Run the following command to use Carthage to install the dependencies:
    carthage bootstrap
  4. Run the following command to open the project in Xcode:
    open FacebookSwift.xcworkspace
  5. In Xcode, select SwiftCatalog as the scheme and build/run.

The dependencies should be build automatically as part of the SwiftCatalog scheme. If you get a compile error on a specific framework, clean the build folder, build that framework, and then build the rest of the project.