https://github.com/yichahucha/ltviewcontrollertransition
Custom transition animation.
https://github.com/yichahucha/ltviewcontrollertransition
Last synced: 2 months ago
JSON representation
Custom transition animation.
- Host: GitHub
- URL: https://github.com/yichahucha/ltviewcontrollertransition
- Owner: yichahucha
- Created: 2018-04-20T07:21:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-25T07:38:45.000Z (almost 5 years ago)
- Last Synced: 2025-02-03T19:23:37.111Z (4 months ago)
- Language: Swift
- Homepage:
- Size: 1.32 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LTViewControllerTransition
## 介绍
1.自定义转场动画,支持手势返回,与系统动画、手势不冲突,使用简单
2.支持 Push、Present## 使用
新建继承自 `LTTransitionManager` 动画类,重写这两个方法,实现动画:
```Objective-C
//实现入场动画
func toAnimation(contextTransition:UIViewControllerContextTransitioning) {
...
}
//实现退场动画
func backAnimation(contextTransition:UIViewControllerContextTransitioning) {
...
}
```使用 ViewController 的分类 `LTTransition` 提供的方法,进行 push、present,传入自定义的动画类
```Objective-C
//动画转场 push
internal func lt_pushViewControler(viewController: UIViewController, transitionManager: LTTransitionManager)
```
```Objective-C
//动画转场 present
internal func lt_presentViewControler(viewController: UIViewController, transitionManager: LTTransitionManager)
```
```Objective-C
//注册手势入场动画
internal func lt_registerToInteractiveTransition(direction: LTEdgePanGestureDirection, eventBlcok: @escaping (() -> Void))
```
```Objective-C
//注册手势退场动画
internal func lt_registerBackInteractiveTransition(direction: LTEdgePanGestureDirection, eventBlcok: @escaping (() -> Void))
```