JTMaterialTransition

An iOS transition for controllers based on material design.

Github星跟踪图

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.

主要指标

概览
名称与所有者johnvuko/JTMaterialTransition
主编程语言Swift
编程语言Ruby (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2015-04-24 22:06:50
推送于2019-01-17 16:45:55
最后一次提交2019-01-17 17:45:14
发布数11
最新版本名称2.0.3 (发布于 )
第一版名称1.0.0 (发布于 )
用户参与
星数1k
关注者数28
派生数86
提交数17
已启用问题?
问题数6
打开的问题数0
拉请求数2
打开的拉请求数0
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?