Forced Unwrapping of Optional in Swift

If statements are used to compare the optional value to nil .If there is a value then we can obtain the value stored in the optional by adding ! at …


If statement in Swift

If statement executes set of instructions only when a given condition is true. Is statement also provides alternative set of statements called else clause for situations when if condition is false.