Skip to content

Instantly share code, notes, and snippets.

@pnalvarez
Created October 16, 2023 12:39
Show Gist options
  • Save pnalvarez/2a38eb8ce78a5e924f4b87e1cb4e4b82 to your computer and use it in GitHub Desktop.
Save pnalvarez/2a38eb8ce78a5e924f4b87e1cb4e4b82 to your computer and use it in GitHub Desktop.
import UIKit
class ViewController: UIViewController {
private lazy var view1: UIView = {
let view = UIView(frame: CGRect(x: 100, y: 100, width: 100, height: 100))
view.backgroundColor = .blue
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
view.addSubview(view1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment