Swift - Strings als Double validieren
Aus Wikizone
Texteingaben auf Double validieren und casten[Bearbeiten]
let input = textView.text // get the input from the text view
if let doubleValue = Double(input) {
// input is a valid double
// you can use doubleValue here
} else {
// input is not a valid double
}