使用NSNotification.userInfo中的NSNumber [UIKeyboardAnimationCurveUserInfoKey]
在Objective C中,我将执行以下操作
[UIView animateWithDuration:1.0 delay:0 options:(curveValue.intValue << 16)
即使bitshift运算符相同,Swift也不允许我这样做.我想获得相当于枚举的原始值
UIViewAnimationoptionCurveEaseInOut = 0<< 16,UIViewAnimationoptionCurveEaseIn = 1<< 16,UIViewAnimationoptionCurveEaSEOut = 2<< 16,UIViewAnimationoptionCurveLinear = 3<< 16,更新 我不确定以下方法是否正确,似乎有效
var animationCurve : UIViewAnimationoptions = UIViewAnimationoptions.CurveEaSEOut info[UIKeyboardAnimationCurveUserInfoKey].getValue(&animationCurve) UIView.animateWithDuration(durationValue.doubleValue,delay: 0,options: animationCurve,animations: {self.navigationController.toolbar.frame = myRect},completion: nil)