This file contains 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
class MyView: UIView { | |
var firstLabel = UILabel() | |
var secondLabel = UILabel() | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
setupView() | |
} |
This file contains 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
extension CodeView { | |
func setupView() { | |
buildViewHierarchy() | |
setupConstraints() | |
setupAdditionalConfiguration() | |
} | |
} |
This file contains 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
protocol CodeView { | |
func buildViewHierarchy() | |
func setupConstraints() | |
func setupAdditionalConfiguration() | |
func setupView() | |
} |
This file contains 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
guard let windowScene = (scene as? UIWindowScene) else { return } | |
window = UIWindow(frame: windowScene.coordinateSpace.bounds) | |
window?.windowScene = windowScene | |
let controller1 = makeController(.red) | |
let controller2 = makeController(.green) | |
let controller3 = makeController(.blue) | |
let controller4 = makeController(.brown) | |
let controller5 = makeController(.cyan) | |
let controller6 = makeController(.orange) |
NewerOlder