Skip to content

Instantly share code, notes, and snippets.

@KentarouKanno
Last active September 19, 2015 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KentarouKanno/22376fdbc8b7410115d7 to your computer and use it in GitHub Desktop.
Save KentarouKanno/22376fdbc8b7410115d7 to your computer and use it in GitHub Desktop.
var a: AnyObject? = 1
var c = (a as! NSNumber)
var array = ["a","b","c"]
var b = array[c.integerValue]
//=> b = "b"
var d = array[(a as! NSNumber).integerValue + 1]
//=> d = "c"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment