-
ios 庫 cocoa library 代母庫
查看全部 -
swift? 不等于 ios 開發,就類似于掌握 Java 語言不等于會 android開發
查看全部 -
Swift 中的 switch 語法不強制要求寫 break 關鍵字。
switch 中的 case 必須窮舉所有可能的取值,或者加上 default 關鍵字。
如果在 default 中什么都不想做,則可以寫一個 break 關鍵字或者寫一個空的括號。
匹配多個 case 的情況:
switch value {
case "a", "A":?
????print("Great!")
case "b", "B":
????print("Just so-so!")
case "c", "C":
????print("It's bad!")
default:
????print("Error!")
}
查看全部 -
至少執行一次的循環:
repeat {
????// do something...
} while (condition)
查看全部 -
數據類型
Int
Float,Double
Boolem
String
Tuple
查看全部 -
guard語句沒發現有什么簡潔的好處??!用if語句一樣做,而且更簡單呢。 例如:課程的例子可以寫成 if (money < price) { print("Not enough money. " return }查看全部
-
學習中查看全部
-
isEmpty 是成員變量?查看全部
-
1.字符串插值查看全部
-
var?imInt:?Int?=?80?//?整型 Int.max?//?check?the?max?value Int.min var?uInt:UInt?=?80 UInt.max UInt.min Int8.max?//127 Int8.min UInt8.max?//255 UInt8.min Int16,32,64 UInt16,32,64 let?binaryInt:Int?=?0b1001?//?二進制賦值 let?binaryInt:Int?=?0o21?//?八進制賦值 let??binaryInt:Int?=?0x11?//?十六進制賦值 let?bignum?=?1_000_000?//?可以帶分隔符號
查看全部 -
let?maxNum=1000?//常量
var?index?=?2??//變量
// Type Inference
x=?"Hello"?//?key?[option?+?mouse]?move?on?"X"?to?check?type
//顯示聲明 let?website:?String
var?a,?b,?c:?Double
查看全部 -
fallthrough? 連續
查看全部 -
https://github.com/liuyubobobo/Play-with-Swift-2
查看全部 -
break
continue
fallthrough
return
throw
五種控制轉移
查看全部 -
可以給for循環,switch等控制語句起個名字
查看全部 -
switch + 元組 可以實現復雜的邏輯。
查看全部
舉報