How to get a value in Swift?
How to get a value in Swift?
- Subject: How to get a value in Swift?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sat, 12 Jul 2014 15:19:50 +0700
keyBrd = center.addObserverForName( UIKeyboardWillShowNotification, object: nil, queue: mainQueue )
{ (b : NSNotification! ) in
let userInfo = b!.userInfo as NSDictionary
let rectEnd = userInfo[UIKeyboardFrameEndUserInfoKey] as NSValue
println("rectEnd \(rectEnd)")
// rectEnd NSRect: {{0, 264}, {320, 216}}
//let rectEnd2 = rectEnd as CGRect
// 'NSValue' is not convertible to 'CGRect'
//let h = rectEnd.size.height
// 'NSValue' does not have a member named 'size'
//let v = rectEnd.rectValue
// 'NSValue' does not have a member named 'rectValue'
// what now?
}
How do I get the height of my rect?
And a completely unrelated question:
let a = ...
println("a is of Class: \( what goes here?)")
How to I get (at runtime) the class of some object?
Gerriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden