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

Overview

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.

Installation

Cocoapods

SKSplashView is available through Cocoapods. To install it, simply add the following to your Podfile.
pod 'SKSplashView'

Alternative

If installation through Cocoapods doesn't work or if you aren't comfortable using it, you can always just drag and drop the folder 'SKSplashView' into your project and `#import "SKSplashView.h"` and you're ready to go.

Implementation

SKSplashView

Simply create an instance of SKSplashView with the desired customizability option.
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

Customizability

The appearance of the splash view can be customized with the following properties:
@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

SKSplashIcon

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];

Customizability

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

Delegate

You can optionally add the SplashView delegate to your view controller to listen to when the splash view begins and ends animating. To do this:
  • 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");
}

Special Feature

SKSplashView also allows you to run a splash animation while executing a network request. This is ideal in situations where your app takes time during launch to download necessary data. By simply calling:
[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.

Example

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.

Community

If you feel you can improve or add more customizability to SKSplashView, feel free to raise an issue/submit a PR. For any questions, reach out to me on Twitter @_sachink

License

SKSplashView is available under the MIT License
Comments
  • Remove use of NSNotificationCenter

    Remove use of NSNotificationCenter

    you always have the instances of SKSplashView and SKSplashIcon handy so you can call their functions without the need for NSNotificationCenter. You can also add a callback to any function where you ned to know when its done (ie stopAnimation for SKSplashIcon)

    opened by acegreen 2
  • iconSize Property doesn't work

    iconSize Property doesn't work

    Hello!

    First thanks for open sourcing your lib! :) Sadly the iconSize property doesn't seem to work. It doesn't reflect any size in the debug and also the setter doesn't do anything on the size. Currently it's hard to fit splash screen icon size with animated icon size. :(

    opened by ctews 2
  • xCode 7 beta 5 warning for synthesis

    xCode 7 beta 5 warning for synthesis

    In SKSplashIcon.m, animationDuration var is not synthesized. I keep getting this warning:

    Auto property synthesis will not synthesize 'animationDuration'; it will be implemented by it's superclass, use @dynamic to acknowledge intention.

    If you synthesize animationDuration, the warning goes away.

    opened by mokshkhurana 2
  • Is it possible to initialize Splash with background View

    Is it possible to initialize Splash with background View

    Hello, I have an idea, maybe you thought this one before, actually i dont know is it possible or not but let me explain; Instead of this

    • (instancetype) initWithSplashIcon:(SKSplashIcon *)icon backgroundImage:(UIImage *) backgroundImage animationType:(SKSplashAnimationType) animationType; can we add a feature like this?
    • (instancetype) initWithSplashIcon:(SKSplashIcon *)icon backgroundView:(UIIView *) backView animationType:(SKSplashAnimationType) animationType; Have you ever tried to code an init method like this one?
    opened by ozanonurtek 1
  • NSInvalidArgumentException crash

    NSInvalidArgumentException crash

    UPDATED:

    HI there, I'm using version 0.1.1 and there are a some exception risen in iPad Air and iPhones with iOS 8.4

    Do you have any clue why is the notification getting lost?

    Thanks

    Fatal Exception: NSInvalidArgumentException -[_UIToolbarBackground receiveNotification:]: unrecognized selector sent to instance 0x145d3d090

    Thread : Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x182fe822c exceptionPreprocess 1 libobjc.A.dylib 0x194a580e4 objc_exception_throw 2 CoreFoundation 0x182fef2f4 __methodDescriptionForSelector 3 CoreFoundation 0x182fec0a8 __forwarding 4 CoreFoundation 0x182eee96c _CF_forwarding_prep_0 5 CoreFoundation 0x182f8e010 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER 6 CoreFoundation 0x182ecb0f0 _CFXNotificationPost 7 Foundation 0x183dfaa80 -[NSNotificationCenter postNotificationName:object:userInfo:] 8 Rentalia 0x1003ff964 -SKSplashView startAnimation 9 Rentalia 0x1000c3f10 -RLHomeViewController splashScreenAnimation 10 Rentalia 0x1000c3bd0 -RLHomeViewController viewDidLoad 11 UIKit 0x187a64a6c -[UIViewController loadViewIfRequired] 12 UIKit 0x187b1ad50 -[UINavigationController _layoutViewController:] 13 UIKit 0x187b1ac4c -[UINavigationController _updateScrollViewFromViewController:toViewController:] 14 UIKit 0x187b1a0d8 -[UINavigationController _startTransition:fromViewController:toViewController:] 15 UIKit 0x187b19d84 -[UINavigationController _startDeferredTransitionIfNeeded:] 16 UIKit 0x187b19aa4 -[UINavigationController __viewWillLayoutSubviews] 17 UIKit 0x187b19a24 -[UILayoutContainerView layoutSubviews] 18 UIKit 0x187a61548 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]

    opened by phynet 1
  • Minor Improvements

    Minor Improvements

    • New init with initialSize parameter
    • twitterSplash animation uses a reference to the launcscreen image to get the initial size but uses a much larger image for the animation itself
    • Removes duplicate SKSplashView folder, now just one reference
    • Ref #8
    opened by acegreen 0
Owner
Sachin Kesiraju
Sachin Kesiraju
Twitter style Splash Screen View. Grows to reveal the Initial view behind

CBZSplashView [![CI Status](http://img.shields.io/travis/Callum Boddy/CBZSplashView.svg?style=flat)](https://travis-ci.org/Callum Boddy/CBZSplashView)

Callum Boddy 1.5k Nov 20, 2022
A Splash view that animates and reveals its content, inspired by Twitter splash

RevealingSplashView A Splash view that animates and reveals its content, inspired by the Twitter splash. โญ Features Customizable reveal icon image. Cu

Chris Jimenez 1.2k Jan 4, 2023
A Splash view that animates and reveals its content, inspired by Twitter splash

RevealingSplashView A Splash view that animates and reveals its content, inspired by the Twitter splash. โญ Features Customizable reveal icon image. Cu

Chris Jimenez 1.2k Dec 17, 2022
Twitter style Splash Screen View. Grows to reveal the Initial view behind

CBZSplashView [![CI Status](http://img.shields.io/travis/Callum Boddy/CBZSplashView.svg?style=flat)](https://travis-ci.org/Callum Boddy/CBZSplashView)

Callum Boddy 1.5k Nov 20, 2022
Navigator - A sample custom car navigator with all main opportunities of popular ones

Navigator A sample custom car navigator with all main opportunities of popular o

Neo 1 Apr 4, 2022
Easy-to-use ICMP Ping for iOS (and maybe OSX)

CDZPinger Easy-to-use ICMP ping for iOS - just create a CDZPinger and you delegate gets a callback every second with the average ping time. Installati

Chris Dzombak 48 Feb 2, 2022
A Currency Converter & Calculator IOS application to check, convert and calculate to popular currencies to your favorite ones.

A Currency Converter & Calculator IOS application to check, convert and calculate to popular currencies to your favorite ones.

CCC 64 Jan 1, 2023
small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api

HomeTwitter Small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api. This is just a s

Sorin Miroiu 1 May 13, 2022
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.

twitter-text This repository is a collection of libraries and conformance tests to standardize parsing of Tweet text. It synchronizes development, tes

Twitter 2.9k Dec 27, 2022
Twitter Kit is a native SDK to include Twitter content inside mobile apps.

Twitter will be discontinuing support for Twitter Kit on October 31, 2018. Read the blog post here. Twitter Kit for iOS Background Twitter Kit is a na

Twitter Archive 674 Dec 18, 2022
๐Ÿฆ An asynchronous Twitter library based on the Twitter v2 API

Twift Twift is an asynchronous Swift library for the Twitter v2 API. No external dependencies Only one callback-based method (requestUserCredentials)

Daniel Eden 91 Jan 1, 2023
Twitter-Client - A twitter client that allow users to view tweets on their iphone

Project 3 - Twitter Client Name of your app is a basic twitter app to read your

null 0 Feb 7, 2022
Added Splash Page, App Icon, and Animations when interacting with the flash cards.

flashcards-app Lab 4 App Description Added Splash Page, App Icon, and Animations when interacting with the flash cards. App Walk-though Required User

juan guillermo 1 Apr 12, 2022
null 13 Oct 28, 2022
Coffee App Splash Screen made with SwiftUI.

SplashScreen-CoffeeApp Coffee App Splash Screen made with SwiftUI. SplashScreen - Code struct ContentView: View { @State var splashScreen = true

Shreyas Bhike 18 Oct 2, 2022
Slide image viewer library similar to Twitter and LINE.

Overview You can use it simply by passing the necessary information! Serrata is a UI library that allows you to intuitively view images. Features King

Takuma Horiuchi 324 Dec 9, 2022
Take home task from one company developed on VIPER, UI Through code and splash from plist

HelloFresh Dev Team - Mobile iOS Developer Test Hello! Thank you for taking the time to try our iOS test. The goal of the test is to assess your codin

Jawad Ali 4 Aug 13, 2022
Highly configurable iOS Alert Views with custom content views

NYAlertViewController NYAlertViewController is a replacement for UIAlertController/UIAlertView with support for content views and UI customization. Fe

Nealon Young 609 Nov 20, 2022
A computer-vision-driven app for detecting and mapping smog in public roads. Crowdsourcing is rewarded with NFTs. Uber Global Hackathon.

Smogify Detecting smog using ML and rewarding users with NFTs About The Project app in action: https://youtu.be/awJrP-sHb_I Under the growing uncertai

ASOFI 3 Aug 18, 2022
Clone the Uber app using iOS15 UIKit

uikit-uber-clone iOS15 UIKit ์„ ํ™œ์šฉํ•ด์„œ Uber ์•ฑ์„ ํด๋ก ํ•œ๋‹ค. ๋ฌด์—‡์„ ๋ฐฐ์šธ๊ฒƒ์ธ๊ฐ€ GeoFire์„ ์ด์šฉํ•ด Geoloca

donggyu 9 Jul 22, 2022