Learn the syntax used in Swift to access properties and call methods on type instances, and understand how the compiler interprets multiline blocks of code.
- [Narrator] Most programming languages use .notation…to call functions and access properties.…Objective-C is one exception which you may be…familiar with the bracket notation to call methods…on objects and it offers both .notation…and bracket notation to get and set properties.….notation is used exclusively in Swift.…I'm going to get into the details of all the code…you see here throughout the course.…But just to briefly walk through it, I have a couple of…structures to represent a car and a driver.…A car has a model property and a drive function…that prints "Vrooooom" when it's called.…
And a driver has a cars property, which is an array of cars.…I've created three car instances and an instance of driver…adding those three cars to its cars property.…Using .notation, I can access the car's property of Scott,…get the first car in the array, and that question mark…there is because a driver may not have any cars.…So the first one will not be there.…I'll go over that in more detail later in…the course, and I'll call drive on it.…
Learn how to write code, understand Swift's key concepts and best practices, and strengthen your programming problem-solving skills. Instructor Scott Gardner teaches the fundamentals, so you'll be prepared to develop applications for iOS, macOS, and other platforms. Completing this course will enable you to not only write first-class code, but to think like a Swift developer.
- Creating playgrounds
- Defining variables and constants
- Working with characters and strings
- Working with collections and groups
- Using operators and defining custom operators
- Controlling program flow
- Defining functions and closures
- Working with classes, structures, and enumerations
- Adopting protocols
Skill Level Beginner
1. Get Started
2. Variables and Constants
3. Characters and Strings
4. Collections and Tuples
6. Control Flow
- 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.