​Quick is just a strong and user-friendly programming language for macOS, iOS, watchOS and tvO...

Page 4

Swift

Type Inference ..................................................................................................................................... 12

5.

SWIFT – VARIABLES .......................................................................................................... 14 Variable Declaration ............................................................................................................................ 14 Type Annotations ................................................................................................................................ 15 Naming Variables ................................................................................................................................ 15 Printing Variables ................................................................................................................................ 16

6.

SWIFT – OPTIONALS ......................................................................................................... 17 Forced Unwrapping ............................................................................................................................. 17 Automatic Unwrapping ....................................................................................................................... 18 Optional Binding.................................................................................................................................. 19

7.

SWIFT – CONSTANTS........................................................................................................ 21 Constants Declaration ......................................................................................................................... 21 Type Annotations ................................................................................................................................ 21 Naming Constants ............................................................................................................................... 22 Printing Constants ............................................................................................................................... 22

8.

SWIFT – LITERALS ............................................................................................................. 24 Integer Literals .................................................................................................................................... 24 Floating-point Literals .......................................................................................................................... 24 String Literals....................................................................................................................................... 25 Boolean Literals ................................................................................................................................... 26

9.

SWIFT – OPERATORS ........................................................................................................ 27 Arithmetic Operators........................................................................................................................... 27 Comparison Operators ........................................................................................................................ 28 Logical Operators ................................................................................................................................ 28 Bitwise Operators ................................................................................................................................ 29 iii


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.