What is the intended use of optional variable/constant in swift
问题 In objC, NSString *stringValue = @"123s"; NSInteger *intValue = [stringValue integerValue]; NSLog(@"intergerValue %@",intValue); if(!intValue) { NSLog(@"caught null object"); } else { // Do appropriate operation with the not null object } prints " interValue (null) " " caught null object " and the binding is done safely by using !(not) operator inside if condition... But whereas, in swift the equivalent snippet using optional variable is var normalValue : String = "123s" var optionalValue =