-
布爾型:Bool->true/false查看全部
-
中文變量:let 姓名 = “IT_xiao小巫"查看全部
-
強(qiáng)制類(lèi)型轉(zhuǎn)換:Int(1.2)->Float查看全部
-
十進(jìn)制、二進(jìn)制ob、八進(jìn)制0o、十六進(jìn)制0x查看全部
-
類(lèi)型,第一個(gè)字母是大寫(xiě)哦查看全部
-
元祖 可選性 高級(jí)的數(shù)據(jù)類(lèi)型 以后學(xué)習(xí)中會(huì)發(fā)揮實(shí)際運(yùn)用查看全部
-
var b:Int! //類(lèi)的構(gòu)造查看全部
-
//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 可選值 或者是一個(gè)值,或者是沒(méi)有值 沒(méi)有值時(shí)位nil查看全部
-
swift 堅(jiān)持學(xué)習(xí)查看全部
-
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,F(xiàn)loat 浮點(diǎn)數(shù) String 字符串型查看全部
舉報(bào)
0/150
提交
取消