SKSplashView

Create custom animated splash views similar to the ones in the Twitter, Uber and Ping iOS app.

  • 所有者: sachinkesiraju/SKSplashView
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

SKSplashView

SKSplashView is a simple class to create beautiful animated splash views for transitioning between views. Perfect as a launch
screen while your app loads.

The splash view allows you to create an animated background view with preset animations with the option of adding a splash icon
that will animate as long as the splash view is animating.

pod 'SKSplashView'
SKSplashView *splashView = [[SKSplashView alloc] initWithBackgroundColor:[UIColor blueColor] animationType:SKSplashAnimationTypeZoom];
// the splashView can be initialized with a variety of animation types and backgrounds. See customizability for more.
splashView.animationDuration = 3.0f; //Set the animation duration (Default: 1s)
[self.view addSubview:splashView]; //Add the splash view to your current view
[splashView startAnimation]; //Call this method to start the splash animation
@property (strong, nonatomic) UIImage *backgroundImage; //Sets a background image to the splash view
@property (nonatomic, assign) CGFloat animationDuration; //Sets the duration of the splash view

The splash view also allows you to customize the animation transition of the splash view with the following types:

SKSplashAnimationTypeFade,
SKSplashAnimationTypeBounce,
SKSplashAnimationTypeShrink,
SKSplashAnimationTypeZoom,
SKSplashAnimationTypeNone

In addition to adding an animated splash view, you can also add an icon on your splash view with its own customizability options that will animate as long as the splash view is running.
To add a splash icon to your splash view:

  1. #import "SKSplashIcon.h" in the view you are presenting the splash view

  2. Initialize the splash icon as follows:

SKSplashIcon *splashIcon = [[SKSplashIcon alloc] initWithImage:[UIImage imageNamed:@"test.png"] animationType:SKIconAnimationTypeNone]; 
//Initialize with the customizability option of your choice. See Customizability for more.
  1. Add the splash icon when you are initializing your splash view
  SKSplashView *splashView = [SKSplashView alloc] initWithSplashIcon:splashIcon backgroundColor:splashColor animationType:SKSplashAnimationTypeFade];

The appearance of the splash icon can be customized with the following properties:

@property (strong, nonatomic) UIColor *iconColor; //Sets the icon color of the icon (Default: white)
@property (nonatomic, assign) CGSize iconSize; //Sets the size of the icon (Default: 60x60)

The animation of the splash icon can also be customized with the following animation types:

SKIconAnimationTypeBounce,
SKIconAnimationTypeGrow,
SKIconAnimationTypeShrink,
SKIconAnimationTypeFade,
SKIconAnimationTypePing,
SKIconAnimationTypeBlink,
SKIconAnimationTypeNone
  • Add <SKSplashDelegate> to your interface

  • Set the delegate to your splash view splashView.delegate = self;

  • Add the following methods to listen to updates

- (void) splashView:(SKSplashView *)splashView didBeginAnimatingWithDuration:(float)duration
{
  NSLog(@"Splash view started animating with duration %f", duration);
}

- (void) splashViewDidEndAnimating:(SKSplashView *)splashView
{
  NSLog(@"Splash view stopped animating");
}
[splashView startAnimationWhileExecuting:request withCompletion:^(NSData *data, NSURLResponse *response, NSError *error) {}];

with an initialized splash view, the splash animation will repeat until you've downloaded everything you need to get started!

Note: This feature currently does not allow animation of the splash view itself but allows for certain splash icon animations.

Some examples of splash views created using SKSplashView (Twitter iOS app and Ping iOS app). All code to the examples is available in the Demo.
If you found a way to mimic another popular iOS app's splash view using SKSplashView, let me know so I can add it here.

For more help getting started with SKSplashView, check out the Demo.

主要指標

概覽
名稱與所有者sachinkesiraju/SKSplashView
主編程語言Objective-C
編程語言Ruby (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2014-11-02 04:50:07
推送於2020-01-07 02:09:26
最后一次提交2020-01-06 17:45:24
發布數4
最新版本名稱0.1.3 (發布於 )
第一版名稱0.1.0 (發布於 )
用户参与
星數472
關注者數17
派生數72
提交數29
已啟用問題?
問題數17
打開的問題數3
拉請求數0
打開的拉請求數0
關閉的拉請求數3
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?