Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnvuko/jtmaterialtransition
An iOS transition for controllers based on material design.
https://github.com/johnvuko/jtmaterialtransition
ios ios-transition material material-design swift transition
Last synced: 1 day ago
JSON representation
An iOS transition for controllers based on material design.
- Host: GitHub
- URL: https://github.com/johnvuko/jtmaterialtransition
- Owner: johnvuko
- License: mit
- Created: 2015-04-24T22:06:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-17T16:45:55.000Z (almost 6 years ago)
- Last Synced: 2024-07-22T10:31:12.260Z (4 months ago)
- Topics: ios, ios-transition, material, material-design, swift, transition
- Language: Swift
- Homepage:
- Size: 392 KB
- Stars: 961
- Watchers: 29
- Forks: 86
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JTMaterialTransition
[![CI Status](http://img.shields.io/travis/jonathantribouharet/JTMaterialTransition.svg)](https://travis-ci.org/jonathantribouharet/JTMaterialTransition)
![Version](https://img.shields.io/cocoapods/v/JTMaterialTransition.svg)
![License](https://img.shields.io/cocoapods/l/JTMaterialTransition.svg)
![Platform](https://img.shields.io/cocoapods/p/JTMaterialTransition.svg)An iOS transition for controllers based on material design.
## Installation
With [CocoaPods](http://cocoapods.org/), add this line to your Podfile.
pod 'JTMaterialTransition', '~> 2.0'
## Screenshots
![Example](./Screens/example.gif "Example View")
## Usage
### Basic usage
```swift
import UIKit
import JTMaterialTransitionclass 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
- [Jonathan VUKOVICH TRIBOUHARET](https://github.com/jonathantribouharet) ([@johnvuko](https://twitter.com/johnvuko))
## License
JTMaterialTransition is released under the MIT license. See the LICENSE file for more info.