Skip to content

Instantly share code, notes, and snippets.

Created October 28, 2012 14:48
Show Gist options
  • Save anonymous/3968790 to your computer and use it in GitHub Desktop.
Save anonymous/3968790 to your computer and use it in GitHub Desktop.
#import "MPAppDelegate.h"
#import "MPViewController.h"
@interface MPAppDelegate()
@property (strong, nonatomic) UIView *wildView;
@end
@implementation MPAppDelegate
- (void)dealloc
{
[_window release];
[_viewController release];
[_wildView release];
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.wildView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.wildView.backgroundColor = [UIColor whiteColor];
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.viewController = [[[MPViewController alloc] initWithNibName:@"MPViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
[NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(toggleWildView) userInfo:nil repeats:YES];
}
- (void)toggleWildView
{
self.wildView.superview ? [self.wildView removeFromSuperview] : [self.window addSubview:self.wildView];
}
#pragma mark - Boilerplate in this example...
- (void)applicationWillResignActive:(UIApplication *)application
{
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
}
- (void)applicationWillTerminate:(UIApplication *)application
{
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment