Giter Club home page Giter Club logo

jkhimagezoomtransition's Introduction

JKHImageZoomTransition

Platform CocoaPods Compatible License

Overview

JKHImageZoomTransition is a simple Swift 2.2 framework that allows you to add Apple-esque view controller transitions whether its presented within a UINavigationController stack or presented modally.

See the example below:

Screen shot

Installation

CocoaPods

You can quickly start using JKHImageZoomTransition by adding the line below to your project's Podfile

pod "JKHImageZoomTransition"

Manual

The source is contained inside the Pod/Classes folder. Simply drag these classes into your project's directory.

Usage

JKHImageZoomTransitionProtocol

Your source and destination view controllers need to implement this protocol to facilitate the transition. The protocol is as follows:

optional func transitionFromImageView() -> UIImageView
optional func transitionToImageView() -> UIImageView
optional func transitionDidFinish(completed: Bool, finalImage: UIImage)

transitionFromImageView is called to fetch the UIImageView from the source view controller

transitionToImageView is called to fetch the UIImageView from the destination view controller

transitionDidFinish is called when the view controller transition ends on the destination view controller

UINavigationController

To use custom view controller transitions inside a UINavigationController as opposed to the standard push and pull transitions, you must first set the navigation controller delegate in your UINavigationController. JKHNavigationControllerDelegate is conveniently provided to override the standard transitions.

Modal Presentation

To use custom view controller transitions modally you must:

  1. Set the transitioningDelegate property in your "from" view controller to self.

  2. Implement the UIViewControllerTransitioningDelegate protocol in your "from" view controller to specify which animation controller to use. (Please see JKHCorgiCollectionViewController.swift as an example)

  3. You'll want to implement the following methods: - animationControllerForPresentedController - animationControllerForPresentedController

  4. Return a new instance of the JKHImageZoomAnimationController with your desired parameters:

    Note: JKHImageZoomType is an enum that specifies whether you want to use a zoom in or zoom out transition.

Requirements

  • iOS 8.0 or higher

Change Log

0.1.0

  • First pre-release.

Author

Joon Ki Hong [email protected]

License

JKHImageZoomTransition is available under the MIT license.

jkhimagezoomtransition's People

Watchers

James Cloos avatar Carabineiro 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.