Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios how simulate back button in a ViewController

i have more viewcontroller that start from rootviewcontroller. So for example i start with controller A so pass to B and go to C the third.

Normally to come back we need to push back on left top. Instead i want to know if is possible instead use back button by code come previus view controller that in this case is B.

to go on the next i use this

ViewController *sc = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];

    [[self navigationController] pushViewController:sc animated:YES];
like image 953
Falco Avatar asked Dec 01 '22 23:12

Falco


1 Answers

Simples

[[self navigationController] popViewControllerAnimated:YES];
like image 60
EagerMike Avatar answered Dec 27 '22 16:12

EagerMike