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:
- Facebook Login - Authenticate people with their Facebook credentials.
- Share and Send dialogs - Enable sharing content from your app to Facebook.
- App Events - Log events in your application.
- Graph API - Read and write to Graph API.
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.ApplicationDelegateAppEvents: A myriad of improvements, including type-safe built-in AppEvents, anAppEventstruct, and more.GraphRequest: You can now implement your own type-safeGraphRequests, 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 fromFacebookCorewith constructors forLoginBehaviorandDefaultAudienceinstead 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
LoginButtonis 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(PreviouslyFBSDKShareAPI): 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-safeOpenGraphPropertyNameandOpenGraphPropertyValueas well as structs forOpenGraphObjectandOpenGraphAction.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(PreviouslyFBSDKGameRequestContent): Now a struct that contains a type-safe enum forRecipientandResult.GameRequest.DialogAppGroupRequest(PreviouslyFBSDKAppGroupContent): Now an enum that encapsulates bothCreateandJoinrequests.AppGroupRequest.DialogAppInvite(PreviouslyFBSDKAppInviteContent): Now a struct that uses a type-safePromotionproperty instead of separatepromotionCodeandpromotionText.AppInvite.Dialog
LoginPeople can sign in to your app with their Facebook login. | SharePeople on your app can share, send a message, or like content in your app. |
Graph APIGet data in and out of Facebook's social graph. Query data, post stories, upload photos and do other tasks. | App EventsUnderstand people's actions in your app and measure the effectiveness of your Mobile App Ads. |
App InvitesPeople can send invites to friends from your app. |