I have swift optional unwrapped variable phone
but when i try to use this variable it gives optional wrapped like below
if let phone = self!.memberItem!.address?.mobile {
print(phone) // Optional(+123232323)
//error "Cannot force unwrap non optional type 'String'".
print(phone!)
}
struct Address{
var tel: String?
var fax: String?
var mobile: String?
var email: String?
}
phone
contains optional value, but when i try to force unwrap this optional it throws error "Cannot force unwrap non optional type 'String'".