var optionals: String?
optionals = "값 있음"
print(optionals!) // "값 있음"
var optionals: String?
optionals = "값 있음"
if optionals != nil {
print(optionals!) // "값 있음"
}
optionals != nil ? print(optionals!) : print("값 없음")
// if-let binding
var optionals: String?
optionals = "값 있음"
if let v = optionals {
print(v) // "값 있음"
}
// guard-let binding
var optionals: String?
optionals = "값 있음"
guard let v = optionals else {
// v가 nil일 경우 로직
}
print(v) // "값 있음"
var optionals: String?
optionals = "값 있음"
print(optionals ?? "") // "값 있음"
open var navigationController: UINavigationController? { get }
navigationController?.pushViewController(ViewController, animated: true)