@IBOutlet weak var layerVIEw: UIVIEw!
overrIDe func vIEwDIDLoad() {
super.vIEwDIDLoad()
// Do any additional setup after loading the vIEw,typically from a nib.
// CATransition 是CAAnimation的子类 用于做转场动画,能够为层提供移出和移入屏幕的方法
}
overrIDe func touchesBegan(_ touches: Set<UItouch>,with event: UIEvent?) {
let Transition:CATransition = CATransition()
Transition.type = kCATransitionPush
Transition.subtype = kCATransitionFromBottom
Transition.duration = 8
Transition.isRemovedOnCompletion = true
let layerVIEwLayer = self.layerVIEw.layer
layerVIEwLayer.add(Transition,forKey: "")
}
overrIDe func dIDReceiveMemoryWarning() {
super.dIDReceiveMemoryWarning()
// dispose of any resources that can be recreated.
}
}
总结
以上是内存溢出为你收集整理的swift中的转场动画全部内容,希望文章能够帮你解决swift中的转场动画所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)