A Splash view that animates and reveals its content, inspired by Twitter splash

Overview

Banner

Build Status codecov.io CocoaPods Compatible Carthage compatible Awesome Language GitHub license

RevealingSplashView

A Splash view that animates and reveals its content, inspired by the Twitter splash.

RevealingSplashView

⭐ Features

  • Customizable reveal icon image.
  • Customizable icon image color.
  • Customizable icon image size.
  • Customizable background color.
  • Customizable animation duration.
  • Customizable animation delay.
  • Several animation to choose from.
  • Easy to use 😉 .

:octocat: Installation

Get RevealingSplashView on CocoaPods, just add pod 'RevealingSplashView' to your Podfile and then run pod install. You can also add the github to your Carthage file.

If you use Carthage you can just install it by adding github "PiXeL16/RevealingSplashView" to your Carthage file.

Using Swift 2.3?

If you are using Swift 2.3, please use the 0.0.6 release.

🤘 Usage

Video Tutorial

Rebeloper created a nice Video Tutorial where you can also learn how to use this control!. You can also follow the docs below

Usage is pretty easy, just initialize your RevealingSplashView in your entry ViewController and in your viewDidLoad() function add it to your view. Then call startAnimation():

import RevealingSplashView

override func viewDidLoad() {
        super.viewDidLoad()

        //Initialize a revealing Splash with with the iconImage, the initial size and the background color
        let revealingSplashView = RevealingSplashView(iconImage: UIImage(named: "twitterLogo")!,iconInitialSize: CGSize(width: 70, height: 70), backgroundColor: UIColor(red:0.11, green:0.56, blue:0.95, alpha:1.0))

        //Adds the revealing splash view as a sub view
        self.view.addSubview(revealingSplashView)

        //Starts animation
        revealingSplashView.startAnimation(){
            print("Completed")
        }

    }

Ideally your iconInitialSize should match the size of the icon in your LaunchScreen.storyboard.

So it you set your constrains in your LaunchScreen.storyboard to be 80 height and 80 width you should set the same size as the initial size of the RevealingSplashView

Custom Icon Color

You are also able to change the color of your iconImage.

import RevealingSplashView

override func viewDidLoad() {
        super.viewDidLoad()
        
        //Initialize a revealing Splash with with the iconImage, the initial size and the background color
        let revealingSplashView = RevealingSplashView(iconImage: UIImage(named: "twitterLogo")!,iconInitialSize: CGSize(width: 70, height: 70), backgroundColor: UIColor(red:0.11, green:0.56, blue:0.95, alpha:1.0))

        revealingSplashView.useCustomIconColor = true
        revealingSplashView.iconColor = UIColor.red

        //Adds the revealing splash view as a sub view
        self.view.addSubview(revealingSplashView)

        //Starts animation
        revealingSplashView.startAnimation(){
            print("Completed")
        }

    }

This will change the actual icon color to red before the animation.

Custom Background Image

You are also able to change the background image of your backgroundImage.

import RevealingSplashView

override func viewDidLoad() {
        super.viewDidLoad()
        
        //Initialize a revealing Splash with with the iconImage, the initial size and the background color
        let revealingSplashView = RevealingSplashView(iconImage: UIImage(named: "twitterLogo")!, iconInitialSize: CGSize(width: 70, height: 70), backgroundImage: UIImage(named: "BackgroundImage")!)

        revealingSplashView.useCustomIconColor = false
        revealingSplashView.iconColor = UIColor.red

        //Adds the revealing splash view as a sub view
        self.view.addSubview(revealingSplashView)

        //Starts animation
        revealingSplashView.startAnimation(){
            print("Completed")
        }

    }

Using NavigationBar or TabBar?

If you are using a NavigationBar or TabBar as your entry view controller, chances are that the animation will look offset by some pixels. There are a couple of options here: Instead of adding the RevealingSplashView to your ViewController, you can add it to your window.

let window = UIApplication.sharedApplication().keyWindow
window?.addSubview(revealingSplashView)

You can also create another entry view controller. Then add the RevealingSplashView to that ViewController instead of the one with the NavigationBar or TabBar. Then after the animation of the RevealingSplashView ends you can transition to your NavigationViewController.

👍 Animations Types

There are several animations to choose from just set the animationType property of the RevealingSplashView

Twitter

Its the default animation that Twitter use for their app. If animationType is not set it will default to this one.

RevealingSplashView

HeartBeat

HeartBeat like animation, unlike the other animations, this special animation allows you to continue to animate until a function its called. This could be more entertaining to the user than having a quick launch and waiting on a spinning wheel if the app needs to fetch more data.

To use the Heartbeat animation you should startAnimation() as normal and then proceed with your network or background job. When you are done, just call

.heartAttack = true

And the splashview should dismiss.

HeartBeatAnimation

Rotate Out

Similar to the Twitter one but rotating while zooming out.

revealingSplashView.animationType = SplashAnimationType.rotateOut

RotateOutAnimation

Pop and Zoom Out

Pop the view a couple of times and zoom out.

revealingSplashView.animationType = SplashAnimationType.popAndZoomOut

RotateOutAnimation

Squeeze and Zoom Out

Squeeze the view and zoom out.

revealingSplashView.animationType = SplashAnimationType.squeezeAndZoomOut

RotateOutAnimation

Swing and Zoom Out

Swings the view and zoom out.

revealingSplashView.animationType = SplashAnimationType.swingAndZoomOut

RotateOutAnimation

Wobble and Zoom Out

Wobbles the view and zoom out.

revealingSplashView.animationType = SplashAnimationType.wobbleAndZoomOut

RotateOutAnimation

TODO

  • Better code coverage
  • More animations

👽 Author

Chris Jimenez - http://code.chrisjimenez.net, @chrisjimeneznat

🍺 Donate

If you want to buy me a beer, you can donate to my coin addresses below:

BTC

1BeGBew4CBdLgUSmvoyiU1LrM99GpkXgkj

ETH

0xa59a3793E3Cb5f3B1AdE6887783D225EDf67192d

LTC

Ld6FB3Tqjf6B8iz9Gn9sMr7BnowAjSUXaV

License

RevealingSplashView is released under the MIT license. See LICENSE for details.

Comments
  • Update for Xcode 10.2 / Swift 5

    Update for Xcode 10.2 / Swift 5

    • bump version
    • bump .swift-version
    • update podspec
    • update Podfile
    • update project to recommended settings
    • convert framework to Swift 5
    • convert sample to Swift 5
    • fix warnings
    $ pod lib lint
    
     -> RevealingSplashView (0.8.0)
        - NOTE  | xcodebuild:  note: Using new build system
        - NOTE  | [iOS] xcodebuild:  note: Planning build
        - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    
    RevealingSplashView passed validation.
    
    opened by weakfl 10
  • Image is not loading at the time of the animation

    Image is not loading at the time of the animation

    This is my code its setup on the entry viewcontroller, and the launchscreen image has the same size image. override func viewDidLoad() { super.viewDidLoad()

        //Initialize a revealing Splash with with the iconImage, the initial size and the background color
        let revealingSplashView = RevealingSplashView(iconImage: UIImage(named:"TanksLogo")!, iconInitialSize: CGSizeMake(100, 100), backgroundColor: UIColor.init(netHex: 0xFDDD26))
    
        //Adds the revealing splash view as a sub view
        //revealingSplashView.iconImage = UIImage(named:"TanksLogo")!
        self.view.addSubview(revealingSplashView)
    
        revealingSplashView.duration = 0.9
    
        revealingSplashView.animationType = SplashAnimationType.PopAndZoomOut
    
        revealingSplashView.startAnimation(){
               //Stuff
        }
    
    opened by CarlosGzz 10
  • Carthage Task failed with exit code 65:

    Carthage Task failed with exit code 65:

    I cannot install it with Carthage:

    *** xcodebuild output can be found in /var/folders/ml/vwq3w1xn44d1j0lfbr77t6cw0000gn/T/carthage-xcodebuild.stHeqG.log *** Building scheme "RevealingSplashView" in RevealingSplashView.xcworkspace Build Failed Task failed with exit code 65:

    Is there a workaround to install it manually?

    help wanted 
    opened by artuan 6
  • App Crashing In Mobile Device SomeTimes, Here is the Crash Report In Swift 3

    App Crashing In Mobile Device SomeTimes, Here is the Crash Report In Swift 3

    Incident Identifier: 0534C147-FE98-4A3A-B687-113BC12F03D3 CrashReporter Key: 7734302ba6a56c065a6000407b53c517d64b4428 Hardware Model: iPhone8,2 Process: MQ [6321] Path: /private/var/containers/Bundle/Application/6E62E705-2A3E-4E37-AB1C-430FD465AC2F/MQ.app/MQ Identifier: MQOFFICIAL.MQ Version: 1 (1.0.0.1) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: MQOFFICIAL.MQ [1933]

    Date/Time: 2017-06-08 19:03:47.9989 -0500 Launch Time: 2017-06-08 19:03:47.9273 -0500 OS Version: iPhone OS 10.3.1 (14E304) Report Version: 104

    Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Description: DYLD, Library not loaded: @rpath/RevealingSplashView.framework/RevealingSplashView | Referenced from: /var/containers/Bundle/Application/6E62E705-2A3E-4E37-AB1C-430FD465AC2F/MQ.app/MQ | Reason: no suitable image found. Did find: | /private/var/containers/Bundle/Application/6E62E705-2A3E-4E37-AB1C-430FD465AC2F/MQ.app/Frameworks/RevealingSplashView.framework/RevealingSplashView: mach-o, but wrong architecture | /private/var/containers/Bundle/Application/6E62E705-2A3E-4E37-AB1C-430FD465AC2F/MQ.app/Frameworks/RevealingSplashView.framework/RevealingSplashView: mach-o, but wrong architecture | /private/var/containers/Bundle/Application/6E62E705-2A3E-4E37-AB1C-430FD465AC2F/MQ.app/Frameworks/RevealingSplashView.framework/RevealingSplashView: mach-o, but wrong architecture Triggered by Thread: 0

    Filtered syslog: None found

    Thread 0 Crashed: 0 dyld 0x000000010023e8bc __abort_with_payload + 8 1 dyld 0x000000010023e268 abort_with_payload_wrapper_internal + 100 2 dyld 0x000000010023e294 fcntl + 0 3 dyld 0x000000010021c3bc dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 0 4 dyld 0x000000010021e9c4 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 4416 5 dyld 0x0000000100219044 _dyld_start + 68

    Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000000000006 x1: 0x0000000000000002 x2: 0x000000016fd2a620 x3: 0x00000000000000a1 x4: 0x000000016fd2a220 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000b10 x8: 0x0000000000000020 x9: 0x0000000000000009 x10: 0x6120676e6f727720 x11: 0x7463657469686372 x12: 0x2c6f2d6863616d20 x13: 0x6f72772074756220 x14: 0x696863726120676e x15: 0x0065727574636574 x16: 0x0000000000000209 x17: 0x0000000000000010 x18: 0x0000000000000000 x19: 0x0000000000000000 x20: 0x000000016fd2a220 x21: 0x00000000000000a1 x22: 0x000000016fd2a620 x23: 0x0000000000000002 x24: 0x0000000000000006 x25: 0x000000010024d000 x26: 0x000000010024fbc8 x27: 0x000000010024d7ac x28: 0x000000010024d000 fp: 0x000000016fd2a1f0 lr: 0x000000010023e268 sp: 0x000000016fd2a1b0 pc: 0x000000010023e8bc cpsr: 0x00000000

    Binary Images: 0x1000d4000 - 0x100113fff MQ arm64 <8ef7633022db3129acca5a64976057ab> /var/containers/Bundle/Application/6E62E705-2A3E-4E37-AB1C-430FD465AC2F/MQ.app/MQ 0x100218000 - 0x10024bfff dyld arm64 /usr/lib/dyld

    EOF

    opened by zaidkhan0 5
  • Carthage and swift 3

    Carthage and swift 3

    The following build commands failed: PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/andresilvagomez/Library/Developer/Xcode/DerivedData/RevealingSplashView-gdkhobhohlmxddbnbzxirdhzohme/Build/Intermediates/RevealingSplashView.build/Release-iphoneos/RevealingSplashView.build/Script-E79891EEF61AFCD36E51FC4B.sh (1 failure) error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. A shell task (/usr/bin/xcrun xcodebuild -workspace /Users/andresilvagomez/CityTaxi/iOS/Carthage/Checkouts/RevealingSplashView/RevealingSplashView.xcworkspace -scheme RevealingSplashView -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65: ** BUILD FAILED **

    The following build commands failed: PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/andresilvagomez/Library/Developer/Xcode/DerivedData/RevealingSplashView-gdkhobhohlmxddbnbzxirdhzohme/Build/Intermediates/RevealingSplashView.build/Release-iphoneos/RevealingSplashView.build/Script-E79891EEF61AFCD36E51FC4B.sh

    opened by andresilvagomez 5
  • Using RevealingSplashView with tabbar and navigation controller

    Using RevealingSplashView with tabbar and navigation controller

    Hi,

    My entry view is in a UINavigationController which is in a UITabBarController. When I add this to my entry view, the splash view eventually stays between the top navigation bar and bottom tabbar. I tried to set negative constraints on top and bottom, hoping to stretch the view but as the nature of tabbar and navigation bar is always to stay on top, this didn't work. I can maybe workaround this by having a top most view just for the splash view and initialize my tabs after the animation but do you know of any better way to accomplish this?

    Thank you.

    opened by batuhanc 5
  • Added Objective-C support

    Added Objective-C support

    Hello @PiXeL16, here is the PR for issue #33.

    Please do test it before merging, I have not done a PR before and I do not want to break anything 😅.

    Thank you again.

    opened by Gringox 4
  • No visible interface for startAnimation function when using Obj-C

    No visible interface for startAnimation function when using Obj-C

    Hello, I am trying to import this module as a part of my iOS app build with Objective-C. I found that the interface for the startAnimation function does not get recognized anywhere. Any help?

    PS: I am using CocoaPods.

    enhancement help wanted 
    opened by Gringox 4
  • Support at least 8.2

    Support at least 8.2

    Hello,

    i like your framework. Great work. But I like to support my App for iOS 8.0 and above. But this Frameworks just wanted iOS 9.2 as oldest Software. Can you fix this? Thank you.

    opened by dungi 4
  • Keyword for protocol inheritance is deprecated

    Keyword for protocol inheritance is deprecated

    File: SplashAnimatable.swift Line: 16

    Warning:

    Using class keyword for protocol inheritance is deprecated; use AnyObject instead

    Fix:

    Replace class with AnyObject

    Can you fix @PiXeL16 ? Thanks in advance!

    opened by lchamp 3
  • Can't fit the screen when use with iPad split view

    Can't fit the screen when use with iPad split view

    Hi, I find a problem when use split view in iPad. If launch app in split view mode, the splash view size keep the full-screen size. It cannot adjust correctly size.

    I found to change following code can work super.init(frame: UIScreen.main.bounds) to super.init(frame: (UIApplication.shared.windows.first!.bounds))

    opened by xdxavier 3
  • heartBeat animation bug

    heartBeat animation bug

    I got an issue with heartBeat animation. My code is this:

    https://pastebin.com/4ZW8REfP

    The HeartBeat isn't stopping to beat, I've tried several times with .heartAttack = true or with the finishHeartBeatAnimation() but its not working properly.

    help wanted 
    opened by M0in4 3
  • how to add loading indicator when waiting starAnimation ?

    how to add loading indicator when waiting starAnimation ?

    Can I add loading indicator before revealingSplashView.startAnimation() is called ? I am using RevealingSplashView when fetching data from Internet, I am using twitter style. but unfortunately if the request time is to long it will make the like freezing. so can I add something like UIActivityIndicatorView below the logo or somewhere else in RevealingSplashView?

    I am new in programming I am sorry if this is trivial

    opened by AgungLaksana 1
Owner
Chris Jimenez
I build Apps for your phone and tablets, also 📸, from 🇨🇷, in 🇩🇪
Chris Jimenez
This component implements transition animation to crumble view-controller into tiny pieces.

StarWars Animation This component implements transition animation to crumble view-controller into tiny pieces. Check this project on dribbble. Also, r

Yalantis 3.7k Dec 29, 2022
Custom-Transition - A repo about custom transition between two view controllers

Custom-Transition in SWIFT This is a repo about custom transition between two vi

Prakash Chandra Awal 0 Jan 6, 2022
🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.

Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexibl

Sebastian Boldt 2.4k Dec 25, 2022
A custom modal transition that presents and dismiss a controller with an expanding bubble effect.

A custom modal transition that presents and dismiss a controller inside an expanding and shrinking bubble. Screenshot Usage Install through CocoaPods:

Andrea Mazzini 3.3k Dec 28, 2022
Simple and elegant Dropdown Transition

Simple and elegant dropdown transition for iOS Why? I needed to perform the dropdown transition in the app I was building and I've found many great li

Aidar Nugmanoff 63 Sep 22, 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 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
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
Create custom animated splash views similar to the ones in the Twitter, Uber and Ping iOS app.

SKSplashView SKSplashView is a simple class to create beautiful animated splash views for transitioning between views. Perfect as a launch screen whil

Sachin Kesiraju 474 Nov 17, 2022
Each step you take reveals a new horizon. You have taken the first step today.

The story Seeing the animations behind Paper, or the transitions behind Mail, being in a world of flat design and transitions, user interaction, app b

Ramon Gilabert 152 Nov 3, 2022
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
A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Arale A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built f

Putra Z. 43 Feb 4, 2022
An Integer type that clamps its value to its minimum and maximum instead of over- or underflowing.

ClampedInteger An Integer type that clamps its value to its minimum and maximum instead of over- or underflowing. Examples let big = ClampedIntege

Berik Visschers 0 Jan 17, 2022
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
UIView subclass that bends its edges when its position changes.

AHKBendableView BendableView is a UIView subclass that bends its edges when its position change is animated. Internally, BendableView contains CAShape

Arek Holko 591 Jul 24, 2022
A UISwitch that infects its superview with its tint color.

UISwitch subclass that 'infects' the parent view with the onTintColor when the switch is turned on. Inspired by this Dribble by Ramotion. Screenshot I

Andrea Mazzini 337 Sep 12, 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
🐦 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
PJFDataSource is a small library that provides a simple, clean architecture for your app to manage its data sources while providing a consistent user interface for common content states (i.e. loading, loaded, empty, and error).

PJFDataSource PJFDataSource is a small library that provides a simple, clean architecture for your app to manage its data sources while providing a co

Square 88 Jun 30, 2022
FlexiblePickerExample - Example of flexible picker that automatically layouts its own content

Flexible Picker The implementation of custom Flexible Picker. Thanks to that vie

Jędrzej 21 Dec 27, 2022