-2

I am creating a project using swift that reads a textfield and converts the string to an int. XCode 6 allows me to use the textfield.text.toInt() function, but xcode 7 beta says that the function is not available. Is there any way to work around this?

Jordan.J.D
  • 7,999
  • 11
  • 48
  • 78
  • This change is explicitly *documented* in the Xcode 7 beta release notes: "String.toInt() has been renamed to a failable Int(String) initializer" ... – Martin R Jul 22 '15 at 20:40

1 Answers1

2

This function has been removed, use the initializer

Int(textfield.text)

instead

Kametrixom
  • 14,673
  • 7
  • 45
  • 62