Create Your First Function Builder in 5 Minutes

Create Your First Function Builder in 5 Minutes

When I first saw SwiftUI, I instantly wondered how it was possible. It didn’t look like Swift. This foreign syntax was extremely expressive compared to UIKit. What used to take a ridiculous amount of UIKit code and possibly a storyboard, now takes ≤6 lines of code:

[…]

Let’s take a look at using the ViewBuilder that powers SwiftUI’s DSL:

[…]

In Swift, creating an attributed string can be a real pain. Wouldn’t it be nice if we could use SwiftUI style syntax?

[…]