其他分享
首页 > 其他分享> > Swift如何给present制作一个渐入视觉效果

Swift如何给present制作一个渐入视觉效果

作者:互联网

Swift开发之present渐入视觉效果

首先要使用这种效果则需要关闭present本身的animated
self.present(vc, animated: false, completion: nil)
然后添加渐入视觉效果:

	let transitionEffect = CATransition()
	transitionEffect.type = .fade
	transitionEffect.duration = 1.0
	transitionEffect.timingFunction = CAMediaTimingFunction(name: .linear)
	self.view.layer.add(transitionEffect, forKey: "cakey")

标签:transitionEffect,self,视觉效果,渐入,Swift,present
来源: https://blog.csdn.net/w15059001146/article/details/112580719