Optionals in Swift

Optional in Swift means the possibility of absence of a value for variable or constant. Optionals are required in many cases in real world programming. Declaring optionals is very simple. You just need to write the type with a trailing question mark

Guard in Swift

A guard statement is used to transfer program control out of a scope if one or more conditions aren’t met also called as early exit. i.e. Either you meet the condition asked, or get out of the scope.guard let is also an alternative to if let, which also unwraps optionals. guard let will unwrap an optional for you and if it finds nil inside, it expects you to exit the function, loop, or condition you used it in.