peetonn peetonn - 1 month ago 29
Swift Question

Does Facebook SDK support Swift 2.3/3.0?

Ok, I can't figure out what's the catch here. I follow all the instructions to configure my new project using CocoaPods to use Facebook SDK. Once I open generated project workspace, Xcode offers me to convert some source code in Pods project to Swift 2.3 or Swift 3.0.

I tried twice - with converting to Swift 3.0 and converting to Swift 2.3. Neither works and both give me on average ~120 compilation-time errors.
What's the deal here? I can't find anyone with similar problems. They seem to support Swift 2.3, but it doesn't work actually.

Xcode 8.0, Deployment target 8.0, latest FB sdk available through pods - 4.16.1

Answer

Facebook version 0.2.0 has support for Swift 3.0. Make sure you do the following before installing the latest version of Facebook SDK:

1: Get the latest version of Cocapods:

gem install cocoapods
(or if the above fails)
sudo gem install cocoapods

2: Update your local specs repo by running:

pod repo update

3: And then update your pod file and run pod update or pod install

pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'

I think your probably missing step 1.

Comments