Convert NSNotification.userInfo[UIKeyboardAnimationCurveUserInfoKey] to Enum

前端 未结 4 2097
失恋的感觉
失恋的感觉 2021-02-14 20:20

Using NSNumber from NSNotification.userInfo[UIKeyboardAnimationCurveUserInfoKey]

In Objective C I would do the following

 [UIView animateWithDuration:1.0         


        
4条回答
  •  隐瞒了意图╮
    2021-02-14 21:14

    You have to init a UIViewAnimationOptions with the rawValue like this:

    UIView.animateWithDuration(1.0, delay: 0, options: UIViewAnimationOptions.init(rawValue:UInt(curveValue.intValue << 16)),

提交回复
热议问题