Giter Site home page Giter Site logo

goodtohear / gcolaunchimagetransition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gonecoding/gcolaunchimagetransition

0.0 3.0 0.0 863 KB

Animates the transition from the launch image to the app's initial view controller on iOS.

Home Page: gonecoding.com

License: Other

Objective-C 95.19% Ruby 4.81%

gcolaunchimagetransition's Introduction

GCOLaunchImageTransition

Animates the transition from the launch image to the app's initial view controller on iOS. Includes customized animation delay and duration, triggering the transition via notification and display of an activity indicator.

If you're using this pod or found it somehow useful, I'd be happy if you'd let me know.

Features

  • Use one of three animations to create a nice transition from your launch image to your app:
  • Fade
  • Zoom In (with Fade)
  • Zoom Out (with Fade)
  • Choose a custom delay before the animation begins
  • Choose a custom duration for the animation effect
  • Easily add an activity indicator with custom position and style
  • Dismiss the transition manually by posting a notification

Example project

To see this pod in action before using it in your project you should download the repository and have a look at the example project that's included.

Download repository as ZIP archive

Installation via CocoaPods

Adding this pod to your project using CocoaPods is a one-liner in your Podfile:

pod 'GCOLaunchImageTransition'

Now run pod install to have CocoaPods handle everything for you.
Never heard of CocoaPods? Do yourself a favor and check it out now.

Usage

The easiest way is to add the following code to your app delegate (e. g. AppDelegate.m):

#import <GCOLaunchImageTransition/GCOLaunchImageTransition.h>

- (void)applicationDidBecomeActive:(UIApplication *)application
{
   [...]

   // Add transition from the launch image to the root view controller's view
   [GCOLaunchImageTransition transitionWithDuration:0.5 style:GCOLaunchImageTransitionAnimationStyleZoomIn];
}

Don't worry, although this code is being added to -applicationDidBecomeActive the code for creating the transition is only executed once โ€” Grand Central Dispatch sees to that with its dispatch_once() method.

You can also create a transition with a (near-)infinite delay that can be dismissed at a specific point by posting a notification:

#import <GCOLaunchImageTransition/GCOLaunchImageTransition.h>

- (void)applicationDidBecomeActive:(UIApplication *)application
{
   [...]

   // Create transition with an near-infinite delay that requires manual dismissal via notification
   [GCOLaunchImageTransition transitionWithInfiniteDelayAndDuration:0.5 style:GCOLaunchImageTransitionAnimationStyleFade];
}

// At some point within your app's startup code dismiss the transition by posting a notification

- (void)someStartupProcedureDidFinish
{
   [[NSNotificationCenter defaultCenter] postNotificationName:GCOLaunchImageTransitionHideNotification object:self];
}

Finally you can add an activity indicator to the launch image transition using the fully customizable transition creation:

#import <GCOLaunchImageTransition/GCOLaunchImageTransition.h>

- (void)applicationDidBecomeActive:(UIApplication *)application
{
   [...]

   // Create fully customizable transition including an optional activity indicator
   // The 'activityIndicatorPosition' is a percentage value ('CGPointMake( 0.5, 0.5 )' being the center)

   [GCOLaunchImageTransition transitionWithDelay:5.0 duration:0.5 style:GCOLaunchImageTransitionAnimationStyleZoomOut activityIndicatorPosition:CGPointMake( 0.5, 0.9 ) activityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
}

Note: You can always use GCOLaunchImageTransitionNearInfiniteDelay for the delay parameter if you prefer to dismiss the transition manually.

ARC Compatibility

This pod is compatible with ARC enabled projects by default. CocoaPods will handle the ARC settings for you.

Contributing

I absolutely appreciate any suggestions or improvements you may have in mind for this pod. That being said the most welcomed form of contribution would be a pull request from your own fork of this repository on GitHub. If you only have a minor problem or suggestion consider opening an issue.

Contact

I'm Michael Sedlaczek, Gone Coding. I'm also using Twitter: @gonecoding

License

GCOLaunchImageTransition is released under the New BSD License. For details see LICENSE.
This license requires attribution when redistributing the component as source code or in binary form.

gcolaunchimagetransition's People

Contributors

gonecoding avatar michaelforrest avatar

Watchers

 avatar James Cloos avatar  avatar

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.