Created
January 4, 2014 16:00
-
-
Save PaulSolt/8256785 to your computer and use it in GitHub Desktop.
Modal Context to Layer UIViewControllers with Transparency
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
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
{ | |
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | |
if (self) { | |
self.gameState = GameStateMenu; | |
self.definesPresentationContext = NO; | |
self.modalPresentationStyle = UIModalPresentationFormSheet; | |
self.menuScreenViewController = [[MenuScreenViewController alloc] init]; | |
self.menuScreenViewController.definesPresentationContext = YES; | |
self.menuScreenViewController.providesPresentationContextTransitionStyle = YES; | |
self.menuScreenViewController.modalPresentationStyle = UIModalPresentationCurrentContext; | |
self.menuScreenViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; | |
self.menuScreenViewController.mainViewController = self; | |
self.pauseScreenViewController = [[PauseScreenViewController alloc] init]; | |
self.pauseScreenViewController.definesPresentationContext = YES; | |
self.pauseScreenViewController.providesPresentationContextTransitionStyle = YES; | |
self.pauseScreenViewController.modalPresentationStyle = UIModalPresentationCurrentContext; | |
self.pauseScreenViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; | |
self.pauseScreenViewController.mainViewController = self; | |
self.deathScreenViewController = [[DeathScreenViewController alloc] init]; | |
self.deathScreenViewController.definesPresentationContext = YES; | |
self.deathScreenViewController.providesPresentationContextTransitionStyle = YES; | |
self.deathScreenViewController.modalPresentationStyle = UIModalPresentationCurrentContext; | |
self.deathScreenViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; | |
self.deathScreenViewController.mainViewController = self; | |
self.storeViewController = [[StoreViewController alloc] init]; | |
self.storeViewController.definesPresentationContext = YES; | |
self.storeViewController.providesPresentationContextTransitionStyle = YES; | |
self.storeViewController.modalPresentationStyle = UIModalPresentationCurrentContext; | |
self.storeViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; | |
self.storeViewController.delegate = self; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment