Skip to content

Instantly share code, notes, and snippets.

@mildocjr
Last active February 5, 2019 21:12
Show Gist options
  • Select an option

  • Save mildocjr/209a2df491467f57772fc317e4dd4790 to your computer and use it in GitHub Desktop.

Select an option

Save mildocjr/209a2df491467f57772fc317e4dd4790 to your computer and use it in GitHub Desktop.
type-cast-1
var someNumber: Int = 150
var someString: String
someString = String(describing: someNumber)
// by using print() we actually perform type casting on integers
print(someNumber) // prints "150"
// the result of print(someNumber) will look the same but it's a
// string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment