How to create and use protocols - Swift for Complete Beginners

Поділитися
Вставка
  • Опубліковано 27 гру 2024

КОМЕНТАРІ • 28

  • @NikitaDrokin
    @NikitaDrokin 4 місяці тому +1

    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!

  • @pmishraofficial
    @pmishraofficial Рік тому +3

    This is one of the most detailed and simplified explanation. Thank you for this series!

  • @BeesBugsJapan
    @BeesBugsJapan 3 роки тому +4

    Paul, thanks! I decided to take a stab are swift and your courses and information has been a godsend.

  • @АртемБатьков-м6ю
    @АртемБатьков-м6ю 2 роки тому +2

    How nice to see you with a dog!

  • @ESquirez
    @ESquirez 3 роки тому +1

    Thank you for this
    You’ve really help me understand protocols

  • @evaanna1298
    @evaanna1298 2 роки тому +2

    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 :)

    • @MeettheStroops
      @MeettheStroops 2 роки тому +2

      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.

    • @MeettheStroops
      @MeettheStroops 2 роки тому

      I dont think i answered your question. Haha sorry i looked at the comments before watching the video.

    • @evaanna1298
      @evaanna1298 2 роки тому

      @@MeettheStroops thank you so much for your reply!

    • @Wang_dadi
      @Wang_dadi 2 роки тому

      @@evaanna1298 did you end up understanding why? I have the same question atm... why use "for" and "using"
      Thanks in advance Eva.

    • @TheSuperFK
      @TheSuperFK 2 роки тому +2

      @@Wang_dadi no clue :) maybe just to show us that two options are possible ?

  • @timborner6987
    @timborner6987 3 роки тому +6

    What a fantastic feature! Also, that's such a cute dog :)

  • @myrondulay8628
    @myrondulay8628 2 роки тому +1

    Thanks Paul. That's one fluffy dog.

  • @xavierrispal9605
    @xavierrispal9605 2 роки тому

    Hello and thanks for this tutorial :)
    I expected to see some override qualifier for each implementation of a protocol function inside the class...

  • @leon.dev89
    @leon.dev89 Рік тому +1

    Didn’t know Protocols can be so complex 😅

  • @th9568
    @th9568 Рік тому

    Paul thank you for this tutorial. What a nice fluffy friend. I was wondering what breed is she?

    • @twostraws
      @twostraws  Рік тому +6

      Both my dogs are Samoyeds. They are very white, very fluffy, and very good with my children!

    • @amandacurtis7245
      @amandacurtis7245 Рік тому

      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. ❤

  • @prabhakaranlpn1694
    @prabhakaranlpn1694 Рік тому

    nice tutorial......
    from India

  • @winterinhead
    @winterinhead Рік тому

    dog so cute!

  • @drakonzai
    @drakonzai Рік тому

    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!

  • @ilgaralizada7206
    @ilgaralizada7206 3 роки тому +5

    Protocol: Doggie))

  • @Muhammed-wo1nr
    @Muhammed-wo1nr Рік тому

    can't concentrate with that cute dog interrupting the tutorial

  • @hamdymubarak3082
    @hamdymubarak3082 Рік тому +1

    Your dog is so cute. Hello Monster. 🦮