Created
July 26, 2022 09:26
-
-
Save danurna/4f4e4faa5315b0448a2538bab344c590 to your computer and use it in GitHub Desktop.
CatViewController Sample
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 CatViewController: UIViewController { | |
lazy var stackView: UIStackView = { | |
let stackView = UIStackView(arrangedSubviews: [ | |
titleLabel, | |
catsView | |
]) | |
stackView.axis = .vertical | |
stackView.distribution = .fill | |
return stackView | |
}() | |
lazy var catsView: CatsUIView = { | |
let catsView = CatsUIView() | |
// Experiment: Disable this and compare it running on iOS 14 and iOS 15 | |
catsView.setContentCompressionResistancePriority(.required, for: .vertical) | |
return catsView | |
}() | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment