Present and dismiss modal view controller

前端 未结 6 913
广开言路
广开言路 2020-11-28 04:45

Can anyone give me the example code that I can use to first present a modal view controller, then dismiss it? This is what I have been trying:

NSLog(@\"%@\",         


        
6条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 05:30

    The easiest way i tired in xcode 4.52 was to create an additional view and connect them by using segue modal(control drag the button from view one to the second view, chose Modal). Then drag in a button to second view or the modal view that you created. Control and drag this button to the header file and use action connection. This will create an IBaction in your controller.m file. Find your button action type in the code.

    [self dismissViewControllerAnimated:YES completion:nil];
    

提交回复
热议问题