I am trying to use the PFLoginViewController to create a simple login screen for my app. The problem I am running into is the ability to switch between the login screen and the main page of the app based on .currentUser() output.
I was able to accomplish this in Objective C using this method:
AppDelegate.m
LogInViewController.m
I'm using Swift in my new app and am trying to duplicate the method I used in Objective C but I'm getting this error and the simulator is all black.]
Here's what my code looks like in swift.
AppDelegate
LoginVC
I have done some looking into this and I've seen that it's an issue with viewDidLoad instead of using viewWillAppear but I don't see the application to my issue because it worked in Objective C in the didFinishLaunchingWithOptions and also the delegate methods of PFLoginViewController aren't called in viewDidLoad.
Any clues as to what's my big mistake?









In the Obj-C you're getting the navigation controller from the window (the root view controller), so it's presented. In the swift you're creating a new navigation controller, and then you might again create another new navigation controller with a root view controller. Neither of these are presented so trying to use them for much other than presenting them won't work. This is a significant logical change between the 2 code samples. There is nothing to stop you following the same approach in each language and it should resolve your error.