Giter Club home page Giter Club logo

revealingsplashview's Introduction

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.

revealingsplashview's People

Contributors

baschte avatar lchamp avatar marekpridal avatar oldtrafford91 avatar pixel16 avatar qasimsina avatar relisiuol avatar senseiphonex avatar shoheiyokoyama avatar weakfl avatar xdxavier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

revealingsplashview's Issues

cpu usage after add this view to window

My Issue is cpu usage after add this view to window and call start animation
after comment this usage cpu usage is 0% after using that cpu usage is 64%,
I don't now whats wrong

Control time of transition

I would like to make the transition slower .
How can i control the time of the transition of the splash view ??

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
    }

Is there a possibility to add a label or imageview to the view?

guys, just a quick question - is there a possibility of adding either a label or another image view above the one that expands? For example - there would be a name twitter and below it - in the screen center - would be the icon that expands (and label stays untouched and disappears...). How can I achieve this effect?

Use default icon color?

I read through the documentation for RevealingSplashView, I was wondering if there's a way to use the default icon color instead of using a custom icon color?

Background image?

Any chances of getting the ability to add a background image instead of just background color?

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?

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

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))

Icon location

Love the splash screen, thank you.

My LaunchScreen.xib has a 80x80 logo image set centered with X/Y constrains. When I run my app, my LaunchScreen is displayed with my logo image centered properly.

However, that being said, the splash screen logo (also set to 80x80) is displayed about 10/15 pixels lower. Is there any way we can add padding to the splash screen logo so as to align both the splash screen logo and the LaunchScreen logo?

This may be because I have navigation items set.

Thanks.

Color icon doesn't work

If I use the color icon instead of the white icon, the splashview will change the icon to white and splash.

Is it a bug or feature?

Below is the code I use.

let revealingSplashView = RevealingSplashView(iconImage: UIImage(named: "color_icon")!, iconInitialSize: CGSizeMake(60, 60),backgroundColor: MaterialColor.grey.lighten5)

is it possible to use it only on Launch Screen ?

Hi ,
It's good library I like it , but I don't like the idea of add it on first view controller because my application won't be on same view controller everytime
what I mean if the user was on any view controller and then close the app and after that open it again
he will be on same view controller as which he was
there isn't a

So only way to be sure the splash animation will display when the app has been open is on launch screen

Unable to compile (installed via Cocoapods) after main project has migrated to Swift 4.2

RevealingSplashView is not currently compatible with Swift 4.2, so once the main project has been migrated it can't be compiled without manually setting the //Swift Language Version// of the RevealingSplashView Target to 'Swift 4'.

Not sure what the preferred way to solve this would be:

  • The current podspec could be updated, with the spec.swift_version property set to '4.0'
  • Wait until Swift 4.2 has been released fully and migrate accordingly.

I think in either case, ultimately setting the swift_version in the podspec would be useful to avoid this sort of thing in the future.

The build errors themselves aren't serious and look to have been addressed by #45.

[HOW] to animate in waiting something

Hi,

How to animate until something like an API callback success ?
i cant play with daily because i don't know how many times taking the API call :/

thanks

Unable to install (pod)

I've tried, rebooted, re-installed CocoaPods etc. Just can't get it to install !

Terminal gives the error:
Analyzing dependencies
[!] Unable to find a specification for RevealingSplashView

any ideas?

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

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

Issues after pod install

Upon installing the RevealingSplashView cocoa pod in my project, I end up with a ton of errors that don't really enable me to use the pod at all. I followed the installation guide and even tried to migrate some of the code to Swift 2.3 (as I wasn't sure if maybe the files were outdated or not) but there seems to be a minor issue when trying to install the pod version 0.0.9.

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.

when I display splashView on the first screen of the app - works fine, otherwise it doesn't

First of all - great plugin, I love it! I'm using .twitter animation type and in my code when I set the StoryBoard Entry Point to the view with splashView (that is set up in viewDidLoad()) - it works great, I see my logo that shrinks and then expands.

But when I put this code in some other view that is reachable by normal segue (push type, animated: false for this segue) - then the icon doesn't shrink - it just immediately expands. Does anyone had a similar problem?

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.

Swift 3.1 support

With xcode 8.3 and Swift 3.1 there is a build error:

M_PI is deprecated.

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.

Add the animation to Appdelegate

Hello,
I tried to add this to app delegate didFinishLaunchingWithOptions
but it's not working... you know any idea to make it work?

Background Image POD Install

Hello,

The last add "Add custom background image function" is not included in tag 0.4.0.

Can you upgrade RevealingSplashView.podspec for checkout the last update ?

Thanks !

Swift 4.2 support

'UIImageRenderingMode' has been renamed to 'UIImage.RenderingMode'
and
'UIViewContentMode' has been renamed to 'UIView.ContentMode'
and
'UIViewAnimationOptions' has been renamed to 'UIView.AnimationOptions'
and
'kCAMediaTimingFunctionEaseInEaseOut' has been renamed to 'CAMediaTimingFunctionName.easeInEaseOut'

Background Image - latest pod

Is the background image available in pod version 0.4.0? It doesn't seem to be working? I can't seem to install 0.5.0 from Coacapods?

I can only use:

let revealingSplashView = RevealingSplashView(iconImage: #imageLiteral(resourceName: "RevealingSplashViewIcon"), iconInitialSize: CGSize(width: 123, height: 123), backgroundColor: UIColor(r: 78, g: 172, b: 248))

background image creates a warning?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.