Xcode 7 allows a view to be added to a scene dock. However, the documentation does not specify how that scene can be made adaptive so it changes its form factor depending on the size class of your device. The view is not relative to any superview so there is no way for it to be constrained to a superview.
How do you make a view in Storyboard's scene dock be adaptive?
Create an outlet in the code and add constraints programmatically. For example:
let margins = self.view.layoutMarginsGuide
yourView.translatesAutoresizingMaskIntoConstraints = false
yourView.leadingAnchor.constraint(equalTo: margins.leadingAnchor).isActive = true
yourView.trailingAnchor.constraint(equalTo: margins.trailingAnchor).isActive = true
yourView.topAnchor.constraint(equalTo: topLayoutGuide.bottomAnchor, constant: 20.0).isActive = true
yourView.heightAnchor.constraint(equalToConstant: 260.0).isActive = true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With