2014-11-07 Swiftでの、if + letによるnilチェックの解説 雑記 業務の都合でSwiftの公式マニュアルを読んでて, 引っかかった箇所があったので、 私がテキトーでゆるふわな解説を行います。 Stack overflow様のように、救済の糸口になれば。 ↓以下のコード↓ var optionalName: String? = "John Appleseed" var greeting = "Hello!" if let name = optionalName { greeting = "Hello, \(name)" } ちょっと分かりにくいですよね。 公式マニュアルの解説を載っけてみます。 You can use if and let together to work with values that might be missing. These v
