How can I call the Facebook delegates using Swift? Xcode doesn't autocomplete and I don't know how use it.
import UIKit
class ViewController: UIViewController,FBLoginViewDelegate {
@IBOutlet var fbLoginView : FBLoginView
override func viewDidLoad() {
super.viewDidLoad()
self.fbLoginView.delegate = self
self.fbLoginView.readPermissions = ["public_profile", "email", "user_friends"]
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// Facebook Delegates
}
I will give one example translation and explain it so that you should be able to translate the rest of the delegate methods:
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user: (id<FBGraphUser>)user;
FBLoginView!FBGraphUser.This leaves us with this translation:
func loginViewFetchedUserInto(loginView : FBLoginView!, user: FBGraphUser)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With