In swift, I'm trying to pull some info out of a keyboard notification:
fun gotKeyboardShowNotification(notification:NSNotification) {
NSLog("gotKeyboardShowNotification: \(notification)")
let theUserInfo = notification.userInfo!
let theFrameBegin = theUserInfo[UIKeyboardFrameBeginUserInfoKey]
let theBeginObject = theFrameBegin!
let theBeginRect = theBeginObject as NSRect
The log shows notification includes UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 736}, {414, 271}}";
but I can't seem to get at the rect:
theUserInfo is type [NSObject:AnyObject]
theFrameBegin is type AnyObject?
theBeginObject is type NSConcreteValue*
theBeginRect is type NSConcreteValue*
I tried various casting and constructs but haven't figured out how to get a CGRect out of this thing!