How to get the most from protocol extensions - Swift for Complete Beginners

Поделиться
HTML-код
  • Опубликовано: 23 янв 2025

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

  • @MarianoTufro
    @MarianoTufro 2 года назад +2

    This video is epic, and the fact that I could follow it with a cold is a testament to how clear you are. Thanks a lot! Protocols and extensions are fascinating. I never liked multiple inheritance.

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

    please more like this. Its so much fun to simplify code after watching your Ideas

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

    You right Paul - I am studying Swift “just for fun” and when I don’t understand something I push myself to study further saying myself “You will understand later on”))

  • @LebenWerden
    @LebenWerden 11 месяцев назад

    Hello,
    struct AAA: Equatable {
    }
    Why is not necassary to implement the static func == ? If you look in the Swift Documentationthe static func is REQUIRED.

    • @twostraws
      @twostraws  11 месяцев назад +1

      Swift is able to create one for us automatically, as long as everything inside the struct already conforms to Equatable.

    • @LebenWerden
      @LebenWerden 11 месяцев назад

      @@twostraws But inside is nothing?How can nothing conforms to Equatable?

    • @twostraws
      @twostraws  11 месяцев назад

      Because two objects with nothing to make them different are automatically considered equal.

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

    extension Numeric {
    func square() -> some Equatable {
    self * self
    }
    }
    The above seems to make the extension more flexible as well...🤷🏿‍♂️

  • @joury-y8z
    @joury-y8z 3 года назад

    It IS confusing, but VERY curious part of me wants to know more about the extension

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

  • @ilgaralizada7206
    @ilgaralizada7206 3 года назад

    I am a beginner bot I find Protocols and Extensions much more easier than Closures)

  • @mhfs61
    @mhfs61 3 года назад

    👍🏼👍🏼👍🏼