Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inamiy/yisplashscreen
Easy splash screen + animation maker for iOS5+.
https://github.com/inamiy/yisplashscreen
Last synced: 5 days ago
JSON representation
Easy splash screen + animation maker for iOS5+.
- Host: GitHub
- URL: https://github.com/inamiy/yisplashscreen
- Owner: inamiy
- Created: 2012-06-14T15:17:53.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-30T10:19:42.000Z (almost 11 years ago)
- Last Synced: 2024-10-31T19:42:29.839Z (12 days ago)
- Language: Objective-C
- Homepage: http://www.moongift.jp/2012/09/20120909-2/
- Size: 6.68 MB
- Stars: 141
- Watchers: 22
- Forks: 32
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
YISplashScreen 1.2.1
====================Easy splash screen + animation maker for iOS5+ (including iOS7).
- `YISplashScreen` creates another UIWindow on top of status-bar so that transition will be nicer, compared to adding splash image directly on `mainWindow.rootViewController.view`.
- `animationBlock` is used to hide splash image with two arguments:
- `splashLayer`: splash image layer
- `rootLayer`: copy of `mainWindow.rootViewController.view.layer`### View hierarchy before animation
- mainWindow (not visible)
- mainWindow.rootViewController.view
- splashWindow
- splashWindow.rootViewController.view (rotateable)
- rootLayer (copy of mainWindow.rootViewController.view)
- splashLayer (splash image layer)Install via [CocoaPods](http://cocoapods.org/)
----------```
pod 'YISplashScreen'
```How to use
----------```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// show splash
[YISplashScreen show];
// simple fade out
[YISplashScreen hide];
return YES;
}
```Hiding Animations
-----------------
```
// simple fade out
[YISplashScreen hide];// cube
[YISplashScreen hideWithAnimation:[YISplashScreenAnimation cubeAnimation]];// manually add animation
[YISplashScreen hideWithAnimationBlock:^(CALayer* splashLayer, CALayer* rootLayer) {
// splashLayer moves up
[CATransaction begin];
[CATransaction setAnimationDuration:0.7];
[CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
splashLayer.position = CGPointMake(splashLayer.position.x, splashLayer.position.y-splashLayer.bounds.size.height);
[CATransaction commit];
}];
```CoreData Migration
------------------
By using `[YISplashScreen showAndWaitForMigration:completion:]` (optional), you can easily integrate simple UIAlertView-confirmation UI.```
[YISplashScreen showAndWaitForMigration:^{
//
// NOTE: add CoreData migration logic here
//
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
[NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
[persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:url
options:options
error:nil];} completion:^{
[YISplashScreen hide];
}];
```License
-------
`YISplashScreen` is available under the [Beerware](http://en.wikipedia.org/wiki/Beerware) license.If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.