The key UIKeyboardAnimationCurveUserInfoKey in the user information dictionary UIKeyboardWillShowNotification contains an Int with a value of 7 .
Now I need to pass this Int to UIView.setAnimationCurve(<here>) . I tried to create the desired UIViewAnimationCurve enum, like this UIViewAnimationCurve(rawValue: 7) . Since the raw value of 7 undocumented, the result is always nil .
It works great in Objective-C. Any idea how to get this animation curve from notification to UIView animation using Swift?
Update: As Martin noted, this is no longer an issue with Xcode 6.3.
From Xcode 6.3 Release Notes :
Imported NS_ENUM types with undocumented values, such as UIViewAnimationCurve, can now be converted from their raw integer values ββusing the init initializer (rawValue :) without reset to nil. Code that used unsafe BitCast as a workaround for this problem can be written to use the initializer for the original value.
source share