KnowledgeCity

Swift: Properties and Protocols

Learn about properties and protocols in Swift
Preview the first lesson free — get full access to all 5 lessons.

To view this video please enable JavaScript.

Course: On-Demand
Advanced  Provider Mark Nair  5 Lessons ·  20m  in English 

Course Description

What are the differences between computed properties and lazy properties in Swift? How can protocols be used to develop structure and clarity within your code? The topics discussed in this course will build on your understanding of the Swift programming language and will explain how to add more value to the classes and structures that you have created in your Swift code. Understanding how properties, extensions, and protocols function in Swift is essential for writing effective and usable code. 

In Swift: Properties and Protocols, we’ll look at properties and protocols in Swift, the advanced aspects of properties, and the customization power they give you.  You’ll learn about computed properties, as well as how to create and use them. You’ll also learn about lazy properties, which are properties you create only when you need them, and how you can implement them. We will also talk about protocols and how they can give you clarity and direction in your code through things like protocol extensions. 

What You'll Learn

  • Understand Swift properties and the advanced aspects they offer
  • Create and use computed properties in Swift
  • Implement lazy properties that are created only when needed
  • Create type extensions in Swift
  • Recognize how protocols work to give code structure and clarity
  • Use protocol extensions to add direction to your code

Key Takeaways

  • Understanding how properties, extensions, and protocols function in Swift is essential for writing effective and usable code.
  • Computed properties and lazy properties are distinct property types, with lazy properties created only when they are needed.
  • Protocols can provide clarity and direction in code through features such as protocol extensions.
  • The course builds on an existing understanding of the Swift programming language to add more value to classes and structures.
  • Properties and protocols give developers customization power over the classes and structures in their Swift code.

Frequently Asked Questions

What topics does this course cover?

The course covers Swift properties and protocols, including computed properties, lazy properties, extensions, protocols, and protocol extensions, along with the advanced aspects of properties and the customization power they provide.

Who is this course for?

It is for learners who already have an understanding of the Swift programming language, as the topics build on that understanding to add more value to the classes and structures they have created in their Swift code.

What will I learn to do with properties?

You will learn about computed properties and how to create and use them, as well as lazy properties, which you create only when you need them, and how to implement them.

What are the learning objectives of this course?

The objectives are to understand Swift properties, identify how to create type extensions, and recognize how protocols work in Swift.

What lessons are included?

The course includes lessons on Computed Properties, Lazy Properties, Extensions, Protocols, and Protocol Extensions.