Swift Delegate Protocol Pattern Tutorial 2023 | iOS Communication Patterns

preview_player
Показать описание

This video explains the Delegate Protocol Communication Pattern in Swift which is how two views communicate in a one-to-one manner. This is a fundamental question in iOS development and I was asked about it a lot during my interviews. In this tutorial I'll walk you through how the delegate protocol pattern in Swift works, using Xcode 14.

This is part of a series of videos about iOS interview questions in Swift. Check out the overview where I list and briefly discuss all the topics that are in this series:

Project Source Code:

iOS Dev Courses:

Twitter:

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Paul Hudson's Hacking With Swift:

Donny Wals - Combine:

Mark Moeyken’s SwiftUI Books:

Ray Wenderlich Books:

#swift #softwaredeveloper #iosdeveloper
Рекомендации по теме
Комментарии
Автор

I've had to rewatch this video a couple of times, but now it has "clicked". Thank you for explaining this in a way so many tutorials did not!

srebulla
Автор

Your original delegates and protocols video was one of the videos that made me discover your channel. Thanks for recreating it. Keep up the good work, Sean!

davidruvinskiy
Автор

The best protocol delegate video in youtube platform. Thanks a lot...

mfgucluer
Автор

5:50 "I'm not actually going to call from within the ViewController, I'm gonna call it from somewhere else". This was a key moment for me to understand conformance. I have previously struggled to understand delegate methods. This helped. Thanks.

djryanashton
Автор

the "job description" concept is on point. thanks.

tzuuyaolee
Автор

Clear and concise, that is exactly what beginners need. Huge thumb-up! You don't skip over the details required to understand new concepts.

mediterrenean
Автор

Dear Sean. I have bought your book, and I was inspired from your story. I want you to know that you have fans from the other side of the world 🇬🇷
Every video you make is so helpful. Thank you for recreating in this version.

YianniYiannakidi
Автор

By far! The best explanation of this topic. Especially the hint that this functinons are getting fired automatically in a lot of framworks. Great job Sean!

marcx
Автор

To prevent strong reference cycles, delegates are declared as weak references (Swift Doc)

In your case this kinda works only because you don't hold a reference to destination. But in real world, in 99% of situations, the owner holds a reference to its delegate, and a delegate has its owner. Hence why you should always use weak, can't go wrong

numb
Автор

Out of all videos that you have made on delegates and protocols, I like this one the most. Also thanks for teaching how to do the bottom sheet as well. Thank you.

nileshjdarji
Автор

Amazing explanation! Really appreciate your videos.

kurdi-
Автор

Big fan of your original video on Delegate as I still refer it to this day. The new video on delegate is an added bonus to my swift learning path. Thank you!

axemanaxeman
Автор

Thanks for spending time explaining analogies and providing source code!

joshuajean
Автор

Thank you, now to create my own example to cement it. Thank you for providing source code and using time to explain analogies vs setting up UI.

joshuajean
Автор

The intern decided to hire himself 😂 I wish it worked like this in real life too 😂

Stu
Автор

Finally a good video about delegate pattern. Thank you Sean!

Maziyarlayeghkar
Автор

Nicely done! In the first 7 seconds of your video I already knew what a Protocol is capable of. Congrats!

EduardoEscaleira
Автор

Amazing explanation, the best Swift YouTuber imo

dan_pal
Автор

Thank you, that was the greatest explanation ever😍😍😍

renagurbanovasenglish
Автор

Thank you so much for this video, right now I am reading your book and it very inspiring!

dmytronice