RESULT BUILDERS AND DSL — X — FILE

THE MAGIC

I STILL DON’ T UNDERSTAND HOW IT WORKS

SwiftUI view builder
SwiftUI view builder at compile time

WHY SHOULD I USE THEM?

RESULT BUILDER ANATOMY

LET’ S CREATE A MARKDOWN(-ish) BUILDER

Some abstractions to make our Markdown editor
Our DSL objects
MarkdownDoc
Vanilla result builder implementation
Vanilla MarkdownDoc
A lot better markdown implementation
Builder method to add only IF statement
Builder methods to add IF-ELSE statement
Magic revealed
Builder methods to add FOR loops

FINAL THOUGHTS

--

--

--

The Xcode Whisperer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Drupal Migration: What’s the Alternative?

Cost Effective Data Streaming

DSA_FAANG_11/10/2021

Devise gem for Rails

Jarvis+’s biweekly report! 2020.7.27–2020.8.9

Overview of Java Virtual Machine

My Frontend Development Journey

My Journey as a CodeChef Chapter Lead

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrea Finollo

Andrea Finollo

The Xcode Whisperer

More from Medium

The Structure of a Swift Package

iOS LayoutTest with method swizzling

Share authentication state across your apps, App Clips and Widgets (iOS)

Open sourcing our BR Radio PlayButton