Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started