Join Harrison Ferrone for an in-depth discussion in this video Type properties, inheritance, and mutation, part of Learning Swift 3 for Developers.
- [Narrator] Make some room at the bottom of the file…and add a new header comment.…Type properties,…Inheritance, and Mutations.…(keyboard clacking)…Let's start our Inheritance example…by defining a new class called base.…Class, Base,…open and closed curly braces.…Inside Base, we're going to have…a static let description…of type String…and this is going to equal Our Base Class.…
We're also going to have a static read only computed String.…Static, var, debug, type String,…and this will return a string…that just says, "DEBUG,"…and we'll use our description.…Both of these static types are type properties.…Meaning, they will belong to all instances…of our base class type.…To round things out,…we're going to put in another string variable…without the static keyword,…so that we can override it later on in our subclass.…
Add var, meaning of life…of type string,…and this is going to return 32.…Now, let's create a new class…that subclasses from base.…Class, megabase,…colon, base.…Now, our megabase class is a subclass of base.…All we're going to do inside this subclass…
- Starting a new playground
- Printing to the console
- Declaring variables
- Working with numbers
- Using strings
- Breaking down optionals
- Understanding closures
- Classes vs. structs
- Extensions and protocols
Skill Level Beginner
1. Hello Swift
2. Back to Basics: Variables and Operators
3. Collections, Tuples, and Enumerations
4. Working with Logic Flows
5. Only in Swift: Optionals
6. Functions, Closures, and Associated Types
7. Classes vs. Structs
8. Advanced Topics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.