ℹ️ This article is also available on his blog.
Layout and Drawing are two different things:
- Layout defines only the positions and sizes of all views on screen.
- Drawing specifies how each view is rendered (how it looks).
import PlaygroundSupport | |
import UIKit | |
func makeLabels(left: String, right: String) -> (UIView, UILabel, UILabel) { | |
let leftLb: UILabel = { | |
let label = UILabel(frame: .zero) | |
label.textAlignment = .left | |
label.backgroundColor = .blue | |
label.text = left | |
return label |
ℹ️ This article is also available on his blog.
Layout and Drawing are two different things: