• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to get a value in Swift?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to get a value in Swift?
      • From: Roland King <email@hidden>
  • Prev by Date: Re: Swift Beta 3 has no more CConstPointer
  • Next by Date: Re: How to get a value in Swift?
  • Previous by thread: Re: Xcode ALWAYS crashes due to data formatter. How do I clear it?
  • Next by thread: Re: How to get a value in Swift?
  • Index(es):
    • Date
    • Thread