Question: Swift Auto Layout A project includes a UIStackView with vertically arranged views. The task is to change the orientation of the stack view to horizontal
Swift Auto Layout
A project includes a UIStackView with vertically arranged views. The task is to change the orientation of the stack view to horizontal when the device's
orientation changes, from portrait to landscape and vice versa.
Which of the following implementations of the traitCollectionDidChange method achieves this?
Pick ONE option
override func traitCollectionDidChange previousTraitCollection: UITraitCollection?
super.traitCollectionDidChangepreviousTraitCollection
if traitCollection.verticalSizeClass previousTraitCollection?.verticalSizeClass
stackView.axis traitCollection.verticalSizeClass compact horizontal : vertical
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
