Here's what I've tried so far
func onKeyboardRaise(notification: NSNotification) {
var notificationData = notification.userInfo
var duration = notificationData[UIKeyboardAnimationDurationUserInfoKey] as NSNumber
var frame = notificationData[UIKeyboardFrameBeginUserInfoKey]! as NSValue
var frameValue :UnsafePointer<(CGRect)> = nil;
frame.getValue(frameValue)
}
But I always seem to crash at frame.getValue(frameValue)
.
It's a little bit confusing because the documentation for UIKeyboardFrameBeginUserInfoKey
says it returns a CGRect
object, but when I log frame
in the console, it states something like NSRect {{x, y}, {w, h}}
.