timerView
定義済みのプロパティを使用して App デリゲートで作成します。
AppDelegate.h
@property (nonatomic, retain) UIView *timerView;
AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[FLViewController alloc] initWithNibName:@"FLViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
self.timerView = [[UIView alloc] initWithFrame:self.window.frame];
[self.timerView setBackgroundColor:[UIColor greenColor]];
[self.window addSubview:self.timerView];
[self.timerView setHidden:YES];
return YES;
}
このビューを前面に表示するコード:
- (IBAction)shouTimerViewTouched:(id)sender {
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[delegate.timerView setHidden:NO];
[delegate.window bringSubviewToFront:delegate.timerView];
}
それでおしまい。https://github.com/rptwshi/TrickTestからデモを実行するためにプルできます。
乾杯。