Skip to content

Instantly share code, notes, and snippets.

@makthrow
Created January 13, 2016 03:25
Show Gist options
  • Save makthrow/5fe3c6ccef49430570d1 to your computer and use it in GitHub Desktop.
Save makthrow/5fe3c6ccef49430570d1 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 = PFLogInViewController()
loginViewController.delegate = self
loginViewController.facebookPermissions = ["public_profile", "email", "user_friends", "user_education_history", "user_birthday"]
loginViewController.fields = [PFLogInFields.Facebook]
loginViewController.emailAsUsername = true
self.presentViewController(loginViewController, animated: false, completion: nil)
loginViewController.signUpController?.delegate = self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment