Intro to Swift Macros - Automatic UI

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

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

  • @uniquecrafter4432
    @uniquecrafter4432 4 месяца назад +3

    Wow. Your video is the best in describing how one should be writing macros in swift. Really appreciate how you went over the purpose of writing the macro and the fundamental steps such as finding the goal before trying to write the macro. Apple WWDC video on this was absolutely bad and never went any of those things you did in this video.

  • @MazenBaddad
    @MazenBaddad 23 дня назад +1

    i just discovered your channel, and what a great channel, Thank you for the free tutorial and keep it up please.

    • @kitlangton
      @kitlangton  22 дня назад +2

      Thanks very much ❤️

  • @deanwthompson5633
    @deanwthompson5633 10 месяцев назад +1

    Fantastic explanation! Great intermediate and above tutorial!

  • @Infinity993
    @Infinity993 Год назад +5

    One of better videos I have seen in a while on the topic of Swift (and its new functionalities), great job on explaining and presenting the new macros.
    Thank you, I hope to see more of your videos in future.

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

      Thanks so much. I’ll surely record some more 🥰

  • @rajeshkumarlingavel6356
    @rajeshkumarlingavel6356 10 месяцев назад +1

    Great video. Looking for more and more content like this.

  • @BekaDemuradze
    @BekaDemuradze Год назад +1

    The only channel where subscription bell is ON. Never gonna miss the video ✌🏻 Thanks for your time

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

      Wowza! I am flattered
      🛎️🔨👌😅

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

    Amazing tutorial!

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

      👯 Very glad you liked it!

  • @hickam16
    @hickam16 Год назад +4

    Thank you so much for explaining something so complex in a simple and relaxed way. Relaxing to watch really.

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

      Thank you for the kind words. Glad to hear macros can be relaxing! 😎

  • @hsjoos99
    @hsjoos99 Год назад +1

    great presentation of this cool swift macro stuff 🏆

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

      Thank you for the trophy!
      🏆
      🙌
      😭

  • @russwhite6424
    @russwhite6424 Год назад +2

    OMG This was just so oddly and wonderfully satisfying. Rust FTW. Kit your talent for presentation is something to aspire to.

    • @kitlangton
      @kitlangton  Год назад +1

      Haha. Thank you! Russ FTW!

  • @spell931
    @spell931 Год назад +3

    You inspired me to write a Macro with your video. I'm going to try to educate my team also.
    Great stuff.

    • @kitlangton
      @kitlangton  Год назад +1

      Hooray! Do it! 😊
      Let me know if you run into any trouble. I’d love to make some follow up videos on any tricky issues people might run into.

    • @spell931
      @spell931 Год назад +2

      @@kitlangton I was able to recreate the Form view like you did based on your tutorial. Having watched your video twice already, I think I understand it even better now.
      One issue I ran into was the optional String type parameter in my model object. In the expanded macro code I ran into compiler error "Global function 'makeValue' requires that 'String?' conform to 'FormBuilder'". Resolved it by checking if the type annotation is 'SimpleTypeIdentifierSyntax.self' and not 'OptionalTypeSyntax.self'.
      I am not really satisfied with my solution as it prevents me from creating a form view that is binded to optional parameter in the model object.

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

      Ah, yes, I didn’t yet handle options or list parameters. We’ll have to come up with some FormBuilder implementation for Option where A has its own FormBuilder. I’ll sketch something up sometime this week :)

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

      ​@@kitlangtonThank you for this video; I just updated my MacBook to try Swift 5.9. Will you make a follow-up video on handling Option types?

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

    Thanks, great explanation!

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

      You're very welcome! Glad to be of service :)

  • @jhoughjr1
    @jhoughjr1 Год назад +2

    Earned a sub. U might be the 3blue1brown of swift macros

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

      Hahaha. That's quit the title :) Thank you very much!

  • @istvanberes8679
    @istvanberes8679 Год назад +1

    Hello!
    Nice video. Can I find the updated part (conformance -> extension) on your twitter/patreon/etc? I am interested in macros, the only problem is the lack of good learning material for it. Your video was the first which got me closer to understanding macros, thanks.🤓

    • @kitlangton
      @kitlangton  Год назад +1

      Thanks! Woo! Very glad to spread the macro love.
      Ah yes, someone else asked about that API change. I'll update the code and throw it on GitHub ASAP :D (hopefully tonight!)

    • @istvanberes8679
      @istvanberes8679 Год назад +1

      @@kitlangton Its great to see something different after hundreds and hundreds of to-do-list tutorial videos.🤪

  • @swiftui_ux
    @swiftui_ux Год назад +1

    I honestly almost fell asleep from the official video This one is really cool explanation! Thank you

    • @kitlangton
      @kitlangton  Год назад +1

      Woo! I always aim to keep folks conscious 😋

  • @Aiiboo
    @Aiiboo Год назад +1

    The ConformanceMarco not in Scope. i saw the are changed to ExtensionMacro, can u show a solution? 😢

    • @kitlangton
      @kitlangton  Год назад +1

      Ah yes, they appeared to have altered that. I'll take a look and update the code/possibly release a small video update.

  • @lucasc0rrea
    @lucasc0rrea Год назад +1

    Amazing video thanks ❤

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

      You're very welcome, Lucas! Thanks for the kind comment :)

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

    Great explanation, thanks

  • @AlanW
    @AlanW 8 месяцев назад +1

    Nice! Thanks for this, very much like your style! (somewhat reminds me of Ambiguous Amphibian). Subscribed in case you one day put up another vid!
    C/C++ macros are literally text search and replace by a pre-processor, so, yeah, they are not "safe" by any sense of the word.

  • @Anonymous-vh9tc
    @Anonymous-vh9tc Год назад +1

    It’s criminal this channel only has 1k subs. I would sub 50 times if I could

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

      Agreed! And I will arrest those who have not subscribed! ⛓️
      p.s. Thanks so much 🥰 and, uh, tell 49,000 other people!

  • @hunterdobb
    @hunterdobb Год назад +1

    Awesome!

  • @KunalKumar-lx9yg
    @KunalKumar-lx9yg Год назад +1

    Amazing

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

      No, you are!
      (Thank you very much 🥰)

  • @HumbleHustle101
    @HumbleHustle101 6 месяцев назад

    Nice video. I have a question regarding swift macros: Can we create such macro that tests the code as we write it. For example If I write a "func add(_ a: Int, _ b: Int) -> Int {
    return a + b
    }" then it writes all the possible unit tests for it like this "func testAdd() {
    // Test case 1: Adding two positive numbers
    assert(add(3, 5) == 8, "Adding 3 and 5 should equal 8")
    // Test case 2: Adding a positive and a negative number
    assert(add(10, -5) == 5, "Adding 10 and -5 should equal 5")
    // Test case 3: Adding two negative numbers
    assert(add(-8, -2) == -10, "Adding -8 and -2 should equal -10")
    // Test case 4: Adding zero to a number
    assert(add(7, 0) == 7, "Adding 7 and 0 should equal 7")
    // Test case 5: Adding zero to zero
    assert(add(0, 0) == 0, "Adding 0 and 0 should equal 0")
    print("All tests passed successfully!")
    }" ?

    • @kitlangton
      @kitlangton  5 месяцев назад

      Ah, for that you'd probably want to look into property based testing :D