iphone - Storyboard - Creating two different Views in storyboard for the same ViewController -


i m new in ios development. m using storyboard application, creating 2 uiview in 1 uiviewcontroller, in first view have 1 button, want when click on button, picker view(second view) display view have 1 picker, 1 done , 1 cancel button.

use below code:

//  viewcontroller.h #import <uikit/uikit.h> @interface viewcontroller : uiviewcontroller{ iboutlet uiview *view1; iboutlet uiview *view2; } @end viewcontroller.m - (void)viewdidload { [super viewdidload]; view2.hidden=yes;} //initially set view2 hidden.    //ibaction methods - (ibaction)go_to_secondview:(id)sender { view1.hidden=yes; view2.hidden=no;}    - (ibaction)done:(id)sender { //your code  } - (ibaction)cancel:(id)sender {  //your code } 

your view controller scene should this: enter image description here


Comments