強制アンラップ
var text: String? = "Hello world"
print(text!)
// Hello world
guard
var text: String? = "Hello world"
guard let text = text else { return }
print(text)
// Hello world
if let
var text: String? = "Hello world"
if let text = text {
print(text)
}
// Hello world
デフォルト値
var text: String? = "Hello world"
print(text ?? "")
// Hello world