How to force a raw value of 7 into a UIViewAnimationCurve enum?

£可爱£侵袭症+ 提交于 2019-12-05 01:43:30
Sebastian Kirsche

I think I figured it out, but I'm not sure if this is the way it's supposed to be done.

let animationCurve = unsafeBitCast(7, UIViewAnimationCurve.self)
UIView.setAnimationCurve(animationCurve)


Update: The solution contained in this question works as well.

var animationCurve = UIViewAnimationCurve.EaseInOut
NSNumber(integer: 7).getValue(&animationCurve)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!