Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8.1 - How to Update Frames for All Views in a Storyboard?

In Xcode 8.1, I can update for each view in the storyboard by clicking on the "Update Frames" button. But I want to update all views, how I can do that?

like image 901
Danh Huynh Avatar asked Oct 29 '16 14:10

Danh Huynh


People also ask

How do I update frames in Xcode?

You can use the keyboard shortcut: Cmd + Opt + = You can also look for "Update Frames", by going to the toolbar and selecting Editor -> Resolve Auto Layout Issues -> Update Frames .

How do I change the view frame in Swift?

You can update it by creating a new CGRect and assigning it to the property. CGRect(x:0, y:0, width:100, height:100) is fine. This initialiser is defined in the CGRect extension.

Why is Main Storyboard not showing up in Xcode?

You have SwiftUI enabled in your project, which does not use storyboards anymore. Your layout is inside the ContentView. swift file. If you do want to work the old way, with storyboards, you should uncheck 'Use SwiftUI' in the project creation screen.


2 Answers

They added one standalone button to the leftmost side in the constraints controls (it looks like a refresh button). And you can also look for "Update Frames", from the toolbar and selecting Editor -> Resolve Auto Layout Issues -> Update Frames if you want you can select "Apply to all views in container" as before.enter image description here. for you reference attaching screenshots.

Update frames example video

like image 115
SARATH SASI Avatar answered Jan 23 '23 18:01

SARATH SASI


It seems to update the frames hierarchically. If you select the main view or even the view controller and press the button, it will update frames for all child views.

like image 26
yonomitt Avatar answered Jan 23 '23 20:01

yonomitt