TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2015 |
Maintained by kavichen.
A view controller which displays the launch image like Zhi Hu Daily.
pod 'KCLaunchImage'
into your Podfile
.pod install
in your terminal.KCLaunchImageViewController.h
and KCLaunchImageViewController.m
into your project(if you install it from pod, just skip this step).FakeLaunchImage
under Images.xcassets
.Create 4 kind of image sets:
FakeLaunchImage-320w-480h@2x
(iPhone4)FakeLaunchImage-320w-568h@2x
(iPhone5)FakeLaunchImage-375w-667h@2x
(iPhone6)FakeLaunchImage-414w-736h@3x
(iPhone6P)Add your own launch image into LaunchImage
.
displayImage
(same as FakeLaunchImage
).AppDelegate.m
file, add those code.\#import "KCLaunchImageViewController.h"
\#import "UIImage+ForiPhone.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIImageView *splashScreen = [[UIImageView alloc] initWithImage:[UIImage autoSelectImageWithImageName:@"FakeLaunchImage"]];
[self.window addSubview:splashScreen];
self.window.rootViewController =
[KCLaunchImageViewController addTransitionToViewController:[[KCViewController alloc] init]
modalTransitionStyle:UIModalTransitionStyleCrossDissolve
withImageName:@"DisplayImage"
taskBlock:^(void){
[splashScreen removeFromSuperview];
}];
return YES;
}
The files should be open in Sketch
If your images shored in images.xcassets
, please set Deployment Target
>= 7.0.
kavichen, [email protected]
KCLaunchImage is available under the MIT license. See the LICENSE file for more info.