Open another view when button is pressed in iOS

前端 未结 1 872
花落未央
花落未央 2020-12-31 09:27

I am completely new to iOS development and I want to load another view when a button is pressed in a present view.

I have created a view based application and follow

相关标签:
1条回答
  • 2020-12-31 10:21
    UIViewController* flipViewController = [[UIViewController alloc] initWithNibName:@"flip.xib" bundle:[NSBundle mainBundle]];
    [self.view addSubview:flipViewController.view];
    

    EDIT:

    UIViewController* flipViewController = [[UIViewController alloc] initWithNibName:@"flip" bundle:[NSBundle mainBundle]];
    [self.view addSubview:flipViewController.view];
    

    Now click on flip.xib, click on the File's Owner on the left hand side of the design area, and change the class to UIViewController. Now CTRL drag from File's Owner icon to the View icon right below it and select the IBOutlet View.

    0 讨论(0)
提交回复
热议问题