Optionals in Swift
Swift introduced a lot of great features one of them is optional. An optional is used where a value may exist or not. This concept doesn’t exist in C or Objective-C. In objective-c if a function returns the absence of an object it would return nil. So we need to handle this case, with something…