Chapter 5. Organizing with Classes and Structures

Swift is an object-oriented language, and as such, it is apropos to devote considerable real estate to the subject. If you are familiar with other object-oriented languages, such as Objective-C and C++, the concepts presented here will be very familiar to you. If you are new to the idea of object-oriented programming (OOP), don’t be alarmed. I’ll take you through a tour of the concepts to prepare you for Swift’s flavor of OOP.

No matter what your current familiarity is with OOP concepts, preparing yourself with a new playground file in Xcode 7 is a good idea. Choose File > New > Playground, and save your new playground file as Chapter 5.playground. You’ll use this playground for all the examples ...

Get Swift for Beginners: Develop and Design, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.