Skip to content

Instantly share code, notes, and snippets.

@miyukki
Created April 17, 2014 02:18
Show Gist options
  • Save miyukki/10948543 to your computer and use it in GitHub Desktop.
Save miyukki/10948543 to your computer and use it in GitHub Desktop.
Suspected SplashScreen on AppDelegate
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// スプラッシュスクリーン画像名の判定
NSString *launchImage;
if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) &&
([UIScreen mainScreen].bounds.size.height > 480.0f)) {
launchImage = @"LaunchImage-700-568h";
} else {
launchImage = @"LaunchImage-700";
}
// スプラッシュスクリーン画像の読み込み
UIImage *splashImage = [UIImage imageNamed: launchImage];
UIImageView *splashImageView = [[UIImageView alloc] initWithImage:splashImage];
// 似非スプラッシュスクリーン画像の表示
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *viewController = [[UIViewController alloc] init];
[self.window addSubview:viewController.view];
[viewController.view addSubview:splashImageView];
[self.window makeKeyAndVisible];
// サーバとの通信など
[Netoworking... ^(){
// 通信のコールバック、値の反映や画面遷移など
// スプラッシュスクリーンを削除
[splashImageView removeFromSuperview];
}];
return YES;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment