Enjoying the preview?
This is the free first lesson. Get full access — request a demo or sign in.
Enjoying the preview?
This is the free first lesson. Get full access — request a demo or sign in.
As you begin building more sophisticated projects, you’ll want to create your own types that include properties and other logic. In this module, you’ll learn about two of those: classes and structures.
We use structures in Swift fairly often. You’ll learn how to build your own structs with your own properties and then how to create instances of those structs to add to this flexibility. Swift is also an object-oriented programming language, so you’ll learn about organizing your code into classes and subclasses and how to initialize your properties in both of them. You’ll also learn the basics of subclass and superclass inheritance, which means how properties in a child class can inherit the traits of those properties from the parent class. Finally, we’ll explore property observers, which are chunks of code that keep watching for changes that may happen within your struct and then act accordingly, depending on the logic you have implemented.
This module covers creating your own custom types in Swift, specifically classes and structures. It includes making structs, creating instances, initializers, property observers, classes, and inheritance.
It is aimed at those beginning to build more sophisticated Swift projects who want to create their own types that include properties and other logic.
You will gain skills in object-oriented programming (OOP), code structure, data structures, structured programming, abstract classes, and application foundation classes.
Inheritance covers the basics of subclass and superclass inheritance, meaning how properties in a child class can inherit the traits of those properties from the parent class.
Property observers are chunks of code that keep watching for changes that may happen within your struct and then act accordingly, depending on the logic you have implemented.