import Foundation import Glibc /* var name: String? /* //-Force unwrapp print(name!) */ /* //-Optional Binding if let myname = name{ print(myname) } */ /* //-Defult Value print(name ?? "t") */ var test: String? test = "123" //1St (Forced Unwrapping) print(test!) //2nd Optional Binding if let tes = test { print(tes) } //3rd Default print(test ?? "t") */ //Guard func test2() { let ss: String? ss = "sdd" guard let num = ss else { print("Error") return } print("ss!") } test2()
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more