I was working on an application that used a text field and translated it into an integer. Previously my code
textField.text.toInt() 
worked. Now Swift declares this as an error and is telling me to do
textField.text!.toInt()
and it says there is no toInt() and to try using Int(). That doesn't work either. What just happened?
                        
In Swift 2.x, the
.toInt()function was removed fromString. In replacement,Intnow has an initializer that accepts aStringIn your case, you could use
Int(textField.text!)insted oftextField.text!.toInt()Swift 1.x
Swift 2.x, 3.x