In this lesson, you learned some of the basics of protocols and how to use them, such as defining common interfaces and specifying the interactions between different parts of your code. Protocols are a tool in your coding backpack that’s similar to inheritance, but each one has different use cases. You should be sure to use the right tool for the job, depending on your circumstances.
In this lesson, you learned:
How to define a protocol in Swift with mutable and immutable properties and functions.
How to create and use a type that conforms to a protocol.
How protocols compare to inheritance, where they differ and why you might prefer protocols over inheritance in some scenarios.
How the compiler can help ensure the types that implement your protocols are correct.
See forum comments
This content was released on Oct 17 2023. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous: Introduction 2
Next: Quiz: Introduction to Protocol-Orientated Programming
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.