I'm trying to convert user input from a textField to an array. I followed the code that was offered here https://stackoverflow.com/a/27501398
let someString : String = someTextField.text!
let someArray = Array(someString).map { String($0).toInt()! }
But then I get this error:
Argument type "String" does not conform to expected type "Sequence"
What am I doing wrong?
It seems that as of Swift 2.0,
String
no longer conforms toSequenceType
. You can work around this if you're really in love with functional programming. However, there's no need to get so fancy here: