- Swift part6 [無断転載禁止]©2ch.net
775 :デフォルトの名無しさん[sage]:2016/03/12(土) 22:29:04.51 ID:MATxlUhm - 出来ない奴が難癖つけてるようにしか聞こえん
if文だと!がいらないんじゃなくて let maybeStr: String? = "Hello, world!" こうあったとして if let str = maybeStr as String { // もし (String? 型の) maybeStr が String 型として str とおけるなら これが、as String (String 型として)は自明なので if let str = maybeStr { // もし (String? 型の) maybeStr が (String型として) str とおけるなら こう省略できるだけ 何が難しいのやら
|
|