Facebook SDK for Swift

Apple's new Swift programming language has brought iOS a new set of APIs, design patterns, and tools.

With the Facebook SDK for Swift, you gain a swift-taylored experience for all of the core Facebook SDK for iOS's APIs. This includes:

Download the SDK for Swift

Frameworks

The frameworks for the Facebook SDK in Swift are organized in the same way as the Facebook SDK for iOS . They also depend upon the Facebook SDK for iOS, although this may change at some point in the future.

FacebookCore.framework (Depends on FBSDKCoreKit.framework)

The following types are included, with enhancements for Swift:

  • AccessToken: Now a struct.
  • ApplicationDelegate
  • AppEvents: A myriad of improvements, including type-safe built-in AppEvents, an AppEvent struct, and more.
  • GraphRequest: You can now implement your own type-safe GraphRequests, including native-typed results.
  • SDKSettings: Logging behaviors are now implemented as a type-safe set, based on Swift enums.
  • Permissions: No longer string-based. Contains separate types for read and write permissions, including a built-in permission list that includes the most common permissions by default.

FacebookLogin.framework (Depends on FacebookCore.framework, FBSDKLoginKit.framework)

The following types are included, with enhancements for Swift:

  • LoginManager: Now uses the type-safe permissions from FacebookCore with constructors for LoginBehavior and DefaultAudience instead of requiring manual setting of properties.
  • LoginButton: Can no longer change permissions after creation, helping to enforce the use of a single login button for a given set of permissions.
  • Note that LoginButton is not intended to work with interface builder or storyboards at this time.

FacebookShare.framework (Depends on FacebookCore.framework, FBSDKShareKit.framework)

The following types are included, with enhancements for Swift:

  • GraphSharer (Previously FBSDKShareAPI): Now a generic type that can handle any type of content.
  • LinkShareContent: Now a struct with an initializer that enforces required properties.
  • OpenGraphShareContent: Now a struct that uses type-safe OpenGraphPropertyName and OpenGraphPropertyValue as well as structs for OpenGraphObject and OpenGraphAction.
  • PhotoShareContent: Now a struct with better type-safety for its properties.
  • VideoShareContent: Now a struct with better type-safety for its properties.
  • ShareDialog: Now a generic type that can handle any type of content.
  • MessageDialog: Now a generic type that can handle any type of content.
  • GameRequest (Previously FBSDKGameRequestContent): Now a struct that contains a type-safe enum for Recipient and Result.
  • GameRequest.Dialog
  • AppGroupRequest (Previously FBSDKAppGroupContent): Now an enum that encapsulates both Create and Join requests.
  • AppGroupRequest.Dialog
  • AppInvite (Previously FBSDKAppInviteContent): Now a struct that uses a type-safe Promotion property instead of separate promotionCode and promotionText.
  • AppInvite.Dialog

Login

People can sign in to your app with their Facebook login.

Share

People on your app can share, send a message, or like content in your app.

Graph API

Get data in and out of Facebook's social graph. Query data, post stories, upload photos and do other tasks.

App Events

Understand people's actions in your app and measure the effectiveness of your Mobile App Ads.

App Invites

People can send invites to friends from your app.