Using PFLogInViewController with Swift

parse-platform, swift

Solution

Download the parse SDK, you will see there are a couple of frameworks present. You need to use the ParseUI.framework. Just drag the framework into your frameworks folder in Xcode, and remember to check the 'copy items if needed' option. Then you should also include the framework in you swift file like so:

import ParseUI

And that's it.

Problem

I am getting a "use of undeclared type" error when trying to use `PFLogInViewController` and `PFLogInViewControllerDelegate` in the default view controller of my Swift project. The code for my ViewController.swift file is below: ``` import UIKit class ViewController: UIViewController, PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. var logInViewController:PFLogInViewController = PFLogInViewController() logInController.delegate = self self.presentViewController(logInController, animated:true, completion: nil) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } ``` I've already imported Parse in the bridging header and am able to send data to the Parse servers. For some reason the `PFLogInViewController` won't work though. Since Parse hasn't updated their tutorial for Swift, I was hoping someone could give me some insight into how to fix this error. Thanks!

Original source