Skip to content

Instantly share code, notes, and snippets.

@makthrow
Created January 12, 2016 21:21
Show Gist options
  • Save makthrow/ee54d3d036dc141037e4 to your computer and use it in GitHub Desktop.
Save makthrow/ee54d3d036dc141037e4 to your computer and use it in GitHub Desktop.
class ViewController: UIViewController, PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate{
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
if (PFUser.currentUser() == nil) {
let loginViewController = LoginViewController()
loginViewController.delegate = self
loginViewController.facebookPermissions = ["public_profile", "email", "user_friends", "user_education_history", "user_birthday"]
loginViewController.signUpController?.delegate = self
loginViewController.fields = [PFLogInFields.Facebook, PFLogInFields.Default]
self.presentViewController(loginViewController, animated: false, completion: nil)
}
else {
getFBUserInfo(PFUser.currentUser()!)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment