​Quick is just a powerful and user-friendly development language for macOS, iOS, watchOS and t...

Page 8

Swift

Difference between Associated Values and Raw Values ...................................................................... 96 Enum with Associated Values .............................................................................................................. 96 Enum with Raw Values ........................................................................................................................ 97

19.

SWIFT – STRUCTURES ...................................................................................................... 99 Definition of a Structure ...................................................................................................................... 99 Accessing the Structure and its Properties ........................................................................................... 99 Best Usage Practices of Structures ..................................................................................................... 101

20.

SWIFT – CLASSES............................................................................................................ 103 Class Identity Operators .................................................................................................................... 105

21.

SWIFT – PROPERTIES...................................................................................................... 107 Stored Properties .............................................................................................................................. 107 Lazy Stored Property ......................................................................................................................... 109 Instance Variables ............................................................................................................................. 109 Computed Properties ........................................................................................................................ 109 Local and Global Variables ................................................................................................................. 112 Type Properties ................................................................................................................................. 112 Querying and Setting Properties ........................................................................................................ 113

22.

SWIFT – METHODS......................................................................................................... 115 Instance Methods .............................................................................................................................. 115 Local and External Parameter Names ................................................................................................ 116 External Parameter Name with # and _ Symbol................................................................................. 117 Self property in Methods ................................................................................................................... 118 Modifying Value Types from Instance Methods ................................................................................ 119 Self Property for Mutating Method ................................................................................................... 120 Type Methods ................................................................................................................................... 121

vii


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