Chapter 5
Object-Oriented Programming
Section 1
Swift as an Object-Oriented Programming Language
Swift provides full support for developing applications in an object-oriented way. Prior to Swift 2, Swift is primarily an object-oriented language in the same way as Java and C#. Here, we will be designing the vehicle types in an object-oriented way and looking at the advantages and the disadvantages of this design. - Look at the basic class diagram that shows how we would design the vehicle class hierarchy - Create a TerrainType enumeration that will be used to define the different vehicle - Create some getter methods that will retrieve the values of the properties.