How to create and use protocols - Swift for Complete Beginners

Поделиться
HTML-код
  • Опубликовано: 13 окт 2024
  • Other videos in the Protocols and Extensions section:
    1. How to create and use protocols: This video
    2. How to use opaque return types: • How to use opaque retu...
    3. How to create and use extensions: • How to create and use ...
    4. How to create and use protocol extensions: • How to create and use ...
    5. How to get the most from protocol extensions: • How to get the most fr...
    6. Summary: Protocols and extensions: • Summary: Protocols and...
    7. Checkpoint 8: • Checkpoint 8 - Swift f...
    You can find the full set of videos, along with transcriptions, challenges, tests, and more, in my free 100 Days of SwiftUI course: www.hackingwit...
    Watch the full Swift for Complete Beginners playlist here: • Swift for Complete Beg...

Комментарии • 27

  • @NikitaDrokin
    @NikitaDrokin 2 месяца назад

    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.

  • @ESquirez
    @ESquirez 3 года назад +1

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

  • @АртемБатьков-м6ю
    @АртемБатьков-м6ю 2 года назад +2

    How nice to see you with a dog!

  • @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...

  • @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 ?

  • @winterinhead
    @winterinhead Год назад

    dog so cute!

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

  • @leon.dev89
    @leon.dev89 Год назад +1

    Didn’t know Protocols can be so complex 😅

  • @prabhakaranlpn1694
    @prabhakaranlpn1694 Год назад

    nice tutorial......
    from India

  • @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 2 года назад +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. 🦮