我试图将最新的Facebook SDK集成到我的iOS swift代码中。当我将登录按钮更新为我的自定义视图时,我得到了:
" UIView setReadPermissions:]:无法识别的选择器已发送到实例"。
这是我的代码:
class ViewController: UIViewController, FBSDKLoginButtonDelegate{
@IBOutlet weak var fbLoginView: FBSDKLoginButton!
override func viewDidLoad() {
super.viewDidLoad()
if (FBSDKAccessToken.currentAccessToken() == nil)
{
println("Not logged in..")
}
else
{
println("Logged in..")
}
self.fbLoginView.readPermissions = ["public_profile", "email", "user_friends"]
self.fbLoginView.delegate = self
}