Last active
March 1, 2021 17:06
-
-
Save theffc/7ed7b4ac57bd3a92fa1baa1af2317364 to your computer and use it in GitHub Desktop.
A comparison between UIKit default `addSubview` method, and a function builder approach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Antes | |
view.addSubview(title) | |
view.addSubview(stackHorizontal) | |
stackHorizontal.addArrangedSubview(icon) | |
stackHorizontal.addArrangedSubview(text) | |
view.addSubview(description) | |
view.addSubview(button) | |
// Depois | |
view.subviews { | |
title | |
stackHorizontal.subviews { | |
icon | |
text | |
} | |
description | |
button | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment