-
布爾型:Bool->true/false查看全部
-
中文變量:let 姓名 = “IT_xiao小巫"查看全部
-
強制類型轉換:Int(1.2)->Float查看全部
-
十進制、二進制ob、八進制0o、十六進制0x查看全部
-
類型,第一個字母是大寫哦查看全部
-
元祖 可選性 高級的數據類型 以后學習中會發揮實際運用查看全部
-
var b:Int! //類的構造查看全部
-
//Optional Binding可選形的解包 if let userAge = userInput.toInt() { println("your age is \(userAge)") userAge } else { println("invaliuserInput: \(userInput)'); }查看全部
-
// Playground - noun: a place where people can play var a:Int a = 1 a var imOptionalVariable:Int? imOptionalVariable = 12 let userInput = "18" let userInput = "abc" var age = userInput.toInt() if age { println("your age is" + String(age!)) } else { println("invalid userInput"); }查看全部
-
Optionals 可選值 或者是一個值,或者是沒有值 沒有值時位nil查看全部
-
swift 堅持學習查看全部
-
The priority of "Double" and "Float" is Double > Float 0b (binary), 0o (octal), 0x (hexadecimal) the number can use "_" to separate without affecting the value static_cast : Int(1.2) == 1 variable name supports unicode encode let 姓名 = "笑了" 姓名 = 姓名 + ".really"查看全部
-
Let means const. Var means variable. variable definitions can be separated by , or ; but ; need to declare the variable type again swift is a "type safety" language variable type is implicitly defined by the initial value also can be explicitly defined: var testStr:String查看全部
-
123查看全部
-
Int 整型 Double,Float 浮點數 String 字符串型查看全部
舉報
0/150
提交
取消