victorz
victorz

Reputation: 39

xcode 9: presentViewController removing all previous controller

I have view controller and implement like this :

loginViewController = [[LoginViewController alloc] init];
loginViewController.delegate = self;
[self.view addSubview:loginViewController.view];
[self addChildViewController:loginViewController];
[loginViewController didMoveToParentViewController:self];

Inside loginViewController, I want to show another view controller but I implement like this :

otherViewController = [[OtherViewController alloc] initWithNibName:nil bundle:nil];
otherViewController.delegate = self;
[self presentViewController:otherViewController animated:YES completion:nil];

Everytime I done with otherViewController and want to dismiss the view controller [self dismissViewControllerAnimated:YES completion:nil];

it restarted from the beginning and not showing the loginViewController. I tried to check using Debug View Hierarchy and got that no loginViewController is implemented when I called presentViewController:otherViewController

Why is this happened ?

Upvotes: 0

Views: 82

Answers (0)

Related Questions