I am new to iOS Application development, please help me how can I go from one view controller
to another view controller
on button click?
Follow the below step,let the button selector is
[button addTarget:select action:@selector(buttonClick) forControlEvents:UIControlEventTouchUpInside];
and implement the selector as
-(void)buttonClick{
UIViewController *controler = [[UIViewController alloc] init];
[self.navigationController pushViewController:controler animated:YES];}
and also make sure viewController has NavigationController embedded within it and replace UIViewController with the Controller you wish to push.
Use this code in your Objective-C
function for navigation -
DashboardViewController *dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DashboardView"];
[dvc setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentViewController:dvc animated:YES completion:nil];
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