Skip to content

Instantly share code, notes, and snippets.

@olxios
Last active June 20, 2016 18:59
Show Gist options
  • Select an option

  • Save olxios/c83e43416b388a61b079ab14e83bc654 to your computer and use it in GitHub Desktop.

Select an option

Save olxios/c83e43416b388a61b079ab14e83bc654 to your computer and use it in GitHub Desktop.
@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