Learning Swift Series: Part 2 – Optionals
In this series we will learn about Optionals in Swift. Optionals in Swift Forced Unwrapping of Optional Optional binding Implicitly…
Optional binding in Swift
If and while statements can be used to check whether an optional has a value and if yes, then extract…
Implicitly Unwrapped Optional in Swift
If the optional variable(or constant) will always have a value but not nil then we can unwrap the optional during…
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…
Learning Swift Series: Part 1 – Basics
In part one of Learning Swift Series, we will deal with the following topics that cover basics of Swift language:…
Type safety and Type inference in Swift
Swift is a type safe language. It performs type checks while compiling our code and flags of any errors due…
Semicolon in Swift
Swift does not require us to use semicolon at the end of each statements although we can do so without…
Comments in Swift
Comments are used to include non-executable text in code. Single line Comment begins with two forward slashes . // Multiline Comment…
Type annotation in Swift
Type Annotation is used to provide information about the type of values stored by the constants and variables. Mostly we…