GithubHelp home page GithubHelp logo

jonathantribouharet / jtmaterialtransition Goto Github PK

View Code? Open in Web Editor NEW
961.0 29.0 86.0 401 KB

An iOS transition for controllers based on material design.

License: MIT License

Ruby 7.86% Swift 92.14%
ios transition material material-design swift ios-transition

jtmaterialtransition's Introduction

JTMaterialTransition

CI Status Version License Platform

An iOS transition for controllers based on material design.

Installation

With CocoaPods, add this line to your Podfile.

pod 'JTMaterialTransition', '~> 2.0'

Screenshots

Example

Usage

Basic usage

import UIKit
import JTMaterialTransition

class ViewController: UIViewController {

    weak var presentControllerButton: UIButton?
    var transition: JTMaterialTransition?

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.transition = JTMaterialTransition(animatedView: self.presentControllerButton)
    }
    
    func didPresentControllerButtonTouch () {
        let controller = SecondViewController()
        
        controller.modalPresentationStyle = .custom
        controller.transitioningDelegate = self.transition
        
        self.present(controller, animated: true, completion: nil)
    }

}

Notes

The animatedView is not directly used, a new view is created based on the frame, backgroundColor properties for the animation. If you don't want to provide a view, you have to set startFrame and startBackgroundColor properties and call init instead of initWithAnimatedView:.

startFrame must be the coordinates relative to the window:

var startFrame = animatedView.superview?.convert(animatedView.frame, to: nil)

Warning

The controller presented must have a backgroundColor else the effect can be a little strange. If you use a UINavigationController or another container don't forget to set the backgroundColor with controllerPresented.view.backgroundColor = UIColor.yourColor.

Requirements

  • iOS 8.0 or higher
  • Swift 4.2

Author

License

JTMaterialTransition is released under the MIT license. See the LICENSE file for more info.

jtmaterialtransition's People

Contributors

jonathantribouharet avatar ronkliffer 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jtmaterialtransition's Issues

Hi!The viewController life cycle abnormality

Hi! @jonathantribouharet

I use the library on my app.

But the viewController not call prefersStatusBarHidden / preferredStatusBarStyle / ViewAppears / ViewDisAppear Methods.

I think the animator don't manage toViewController and formViewController Life Cycle.

But i have no idea due with problem.

Hope you help me.

Jack

Transitioning into View

Hello, what would be the best way to transition into the view itself, not just to a color?

Imagine opening the camera view for taking a photo, or a complex view with a lot of controls. Transitioning into a solid color doesn't feel right.

Thank you, if you show me a direction I would like to submit a pull request.

Animation is different if you use a NavigationController

The JTMaterialTransition works perfectly if I use a regular ViewController as the presentedViewController.

If I present a NavigationController or a NavigationController that holds a SWRevealViewController (which is a VC Library that allows you to have drawers), the animation isn't as fluid (it looks worse). Is there any quick workaround to this?

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.