Intro to Swift Macros — Automatic UI

preview_player
Показать описание
In order to get a taste of Swift's shiny, new macro system, we will implement a macro, start-to-finish, allowing us to derive user interfaces at compile-time.

WWDC's demo videos—as wonderful as they are—elide a good deal of real-world complexity and nuance. Hopefully, a longer-form video such as this, implementing a semi-non-trivial macro from scratch, will help allay some macro-related anxiety. Macros really shouldn't be as intimidating as they tend to be, so let us defang them together.

Рекомендации по теме
Комментарии
Автор

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

MazenBaddad
Автор

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.

uniquecrafter
Автор

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

rajeshkumarlingavel
Автор

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.

Infinity
Автор

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

BekaDemuradze
Автор

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

russwhite
Автор

Fantastic explanation! Great intermediate and above tutorial!

deanwthompson
Автор

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

spell
Автор

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

hickam
Автор

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

jhoughjr
Автор

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.

AlanW
Автор

great presentation of this cool swift macro stuff 🏆

hsjoos
Автор

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

istvanberes
Автор

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

swiftui_ux
Автор

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

Anonymous-vhtc
Автор

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!")
}" ?

HumbleHustle
Автор

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

Aiiboo