Swift 实现可拖动收回转场动画
2020-05-17 本文已影响0人
天然酱油
首先上效果:
1589698106340.gifDemo地址:
HSTransitionDemo
目前没有支持pod,主要是不会弄,执行注册cocoapodz命令一直失败
pod trunk register xxxx@qq.com 'xxx'
[!] An internal server error occurred. Please check for any known status issues at https://twitter.com/CocoaPods and try again later.
如何使用
var aniamtion: HSCoverVerticalTransition!
public init() {
super.init(nibName:nil, bundle:nil)
self.aniamtion = HSCoverVerticalTransition.init(present: self, dismiss: true)
self.transitioningDelegate = self.aniamtion
}
override func viewDidLoad() {
super.viewDidLoad()
self.preferredContentSize = CGSize.init(width: self.view.bounds.width, height: 450)
}
原理
原理暂时就不讲了,网上有很多大神的文章,以后有时间可以整理补充