vendredi 31 juillet 2015

REFrostedViewController: Opening storyboard view controllers from AppDelegate

I'm using the REFrostedViewController repo to have a drop down menu in my iOS app. I am using storyboards opposed to the creator's xib implementation. It works beautifully but I am having a problem implementing a new function in my app. I am trying to present a view controller using AppDelegate.m when I get a notification on my device.

Currently, I'm just trying to open a new view controller after the app has been launched for a few seconds. Since I'm trying to open it after a notification, I decided to put the code in my AppDelegate file. Whenever I run the code and debug it, I see all the values being allocated correctly but nothing happens.

Rundown: App launches -> first screen -> wait 6 seconds -> open new view controller -> nothing worked.

All attempts so far has given me no results and I'm not sure how to move from here. I'm looking for suggestions/ideas/possible answer on what I should do.

The usual process to open another view controller is:

// Init navigationController
NavigationController *navigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"contentController"];
// Init destination view controller
UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"viewController"];
navigationController.viewControllers = @[vc];

// set destination to view controller
self.frostedViewController.contentViewController = navigationController;
[self.frostedViewController hideMenuViewController];

Let me know if there needs to be more information. Thanks!

Aucun commentaire:

Enregistrer un commentaire