Last active
June 20, 2016 18:59
-
-
Save olxios/c83e43416b388a61b079ab14e83bc654 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface SecondViewController () | |
| @property (nonatomic) BOOL isPresented; // This property is very important | |
| @end | |
| @implementation SecondViewController | |
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| self.isPresented = YES; // Set it to true, when controller is initialised | |
| } | |
| - (IBAction)dismiss:(id)sender | |
| { | |
| self.isPresented = NO; // Set this flag to NO before dismissing controller, so that correct orientation will be chosen for the bottom controller | |
| [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment