📜  在 swift 代码示例中解析以加倍任何数据类型

📅  最后修改于: 2022-03-11 15:01:03.350000             🧑  作者: Mango

代码示例3
if let cost = Double(textField.text!) {
    print("The item is valued at: \(cost)")
} else {
    print("Not a valid number: \(textField.text!)")
}