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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?