Book Image

Mastering Swift

By : Jon Hoffman
Book Image

Mastering Swift

By: Jon Hoffman

Overview of this book

Table of Contents (22 chapters)
Mastering Swift
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. Classes and Structures

The first programming language that I learned was BASIC. It was a good language to begin programming with, but once I traded in my Commodore Vic-20 for a PCjr (yes I had a PCjr and I really enjoyed it) I realized that there were other, more advanced languages out there and I spent a lot of time learning Pascal and C. It wasn't until I started college that I heard the term Object Oriented Language. At that time, Object Oriented languages were so new that there were no real courses on them yet, but I was able to experiment a little with C++. After I graduated, I left Object Oriented programming behind and it really wasn't until several years later, when I started to experiment with C++ again, that I really discovered the power and flexibility of Object Oriented programming.

In this chapter, we will cover the following topics:

  • Creating and using classes and structures

  • Adding properties and property observers to classes and structures

  • Adding methods to classes and...