I've always been confused by how protocols work. The way you've explained it like I was 5 was perfect! It's literally just a bare requirement for structs, and it allows for custom types for richer inference. Thank you!
Hey! I have a question. Why do we give the estimateTime function parameter (for distance: Int), but function travel gets only (distance: Int), without "for" ? thank you :)
Im still new to this too but "for" is an external parameter name that you will use when calling the func and "distance" is an internal parameter name that you will use within the function. Another example of this would be using an "_" as a external parameter name. estimateTime(_ distance: Int) The "_" is placed in the external parameter name and allows you to omit it. So when calling the func you only need the value. estimateTime(12). All of this is to make the code more legible to anyone looking at it.
Love Samoyeds! I was bobbing between that and american Eskimo but the dog looked too big for that breed so I was leaning Samoyed. 😊 Thank you so much for this clear explanation of protocols! I will be checking out more videos on your channel. ❤
I've always been confused by how protocols work. The way you've explained it like I was 5 was perfect! It's literally just a bare requirement for structs, and it allows for custom types for richer inference. Thank you!
This is one of the most detailed and simplified explanation. Thank you for this series!
Paul, thanks! I decided to take a stab are swift and your courses and information has been a godsend.
How nice to see you with a dog!
Thank you for this
You’ve really help me understand protocols
Hey! I have a question. Why do we give the estimateTime function parameter (for distance: Int), but function travel gets only (distance: Int), without "for" ? thank you :)
Im still new to this too but "for" is an external parameter name that you will use when calling the func and "distance" is an internal parameter name that you will use within the function. Another example of this would be using an "_" as a external parameter name. estimateTime(_ distance: Int) The "_" is placed in the external parameter name and allows you to omit it. So when calling the func you only need the value. estimateTime(12). All of this is to make the code more legible to anyone looking at it.
I dont think i answered your question. Haha sorry i looked at the comments before watching the video.
@@MeettheStroops thank you so much for your reply!
@@evaanna1298 did you end up understanding why? I have the same question atm... why use "for" and "using"
Thanks in advance Eva.
@@Wang_dadi no clue :) maybe just to show us that two options are possible ?
What a fantastic feature! Also, that's such a cute dog :)
Thanks Paul. That's one fluffy dog.
Hello and thanks for this tutorial :)
I expected to see some override qualifier for each implementation of a protocol function inside the class...
Didn’t know Protocols can be so complex 😅
Paul thank you for this tutorial. What a nice fluffy friend. I was wondering what breed is she?
Both my dogs are Samoyeds. They are very white, very fluffy, and very good with my children!
Love Samoyeds! I was bobbing between that and american Eskimo but the dog looked too big for that breed so I was leaning Samoyed. 😊
Thank you so much for this clear explanation of protocols! I will be checking out more videos on your channel. ❤
nice tutorial......
from India
no
dog so cute!
HAHA I audibly chortled when you said "if you're in one of the handful of countries that like miles" 3:50
great video too!
Protocol: Doggie))
can't concentrate with that cute dog interrupting the tutorial
Your dog is so cute. Hello Monster. 🦮