​Quick is a strong and instinctive programming language for macOS, iOS, watchOS and tvOS....

Page 5

Swift

Assignment Operators ......................................................................................................................... 30 Range Operators.................................................................................................................................. 31 Misc Operators .................................................................................................................................... 31 Operators Precedence ......................................................................................................................... 32

10.

SWIFT – DECISION MAKING ............................................................................................. 33 if Statement......................................................................................................................................... 34 if-else Statement ................................................................................................................................. 35 if...else if...else Statement ................................................................................................................... 36 Nested If Statements ........................................................................................................................... 38 Switch Statement ................................................................................................................................ 39 The ? : Operator .................................................................................................................................. 41

11.

SWIFT – LOOPS ................................................................................................................ 42 for-in Loop ........................................................................................................................................... 43 Swift – for Loop ................................................................................................................................... 44 Swift – while Loop ............................................................................................................................... 46 Swift – do-while Loop .......................................................................................................................... 47 Loop Control Statements ..................................................................................................................... 49 Swift – continue Statement ................................................................................................................. 49 Swift – break Statement ...................................................................................................................... 51 Swift – Fallthrough Statement ............................................................................................................. 53

12.

SWIFT – STRINGS ............................................................................................................. 56 Create a String ..................................................................................................................................... 56 Empty String ........................................................................................................................................ 56 String Constants .................................................................................................................................. 57 String Interpolation ............................................................................................................................. 58 String Concatenation ........................................................................................................................... 58 iv


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