There is a current view as UIViewController
which call "LoginView" but I'm not in, I'm in a NSObject
class and I want to call, display an other UIViewController
which is call "MapView". How can I do this?
The problem is like above screenshot.
I used like this in my NSObject class:
[[[UIApplication sharedApplication] delegate].window.rootViewController presentViewController:yourMapViewContorller animated:YES completion:nil];
I hope it's useful.
At your IBAction
or specific method write this:
UIWindow *window=[UIApplication sharedApplication].keyWindow;
UIViewController *root = [window rootViewController];
UIStoryboard *storyboard = root.storyboard;
CustomViewController *vcc =(CustomViewController *) [storyboard instantiateViewControllerWithIdentifier:@"storyBoardID"];
[root presentModalViewController:vcc animated:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With