AykutE
AykutE

Reputation: 344

Showing view controller from AppDelegate when notification arrived

I am tring to show UIViewController which is inside the UIStoryboard. There isn't any problem about poping up the view. But the navigation is not working in the popup viewcontroller; such as when I touch back button

 [self.navigationController popViewControllerAnimated:YES];

I am using that code in AppDelegate --> didReceiveRemoteNotification method

 UIStoryboard *mystoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
 PFProfileInfoVC *viewcontroller = [mystoryboard instantiateViewControllerWithIdentifier:@"SBID_ProfileVC"];
 viewcontroller.strAuthorID = [userInfo objectForKey:@"aps"][@"targetId"];
 [self.window.rootViewController presentViewController:viewcontroller animated:YES completion:nil];

Thanks,

Upvotes: 0

Views: 255

Answers (1)

Leo
Leo

Reputation: 24714

When you use presentViewController, the viewController is not pushed onto the navigation stack. Normally, it is presented modally. So if you want to dismiss it, use

 [self dismissViewControllerAnimated:true completion:nil];

Upvotes: 1

Related Questions