Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to more easily "update all frames" in autolayout in Xcode7?

The "Update Frames" calls are often grayed-out in Xcode

enter image description here

the only way I know to have it update frames to match your constraints, is, tediously select your highest-level view and than (sometimes) you can fish in the menu bar for "Selected Views"->"Update Frames". Further, "All Views"->"Update Frames" would appear to often simply not work or work in a way I can't understand.

Surely there's just a keystroke or button which updates all frames straight away to match any newly-entered constraints (such as those made using control-drag).


Note .. for 2016 you can use this very handy button, which at least brings up the same sub-menu as you can find by searching in the menu bar menu.

enter image description here

However it would seem (see my comments w/ ZaBlanc below) that there is perhaps actually an Xcode bug, and you CAN NOT assign a keystroke to the "All Views" items. (The ones you usually use.)

Even worse .. in Xcode 8 ...

they seem to have removed the 'update frames' option ... WTH

like image 297
Fattie Avatar asked Sep 18 '15 15:09

Fattie


1 Answers

It's easy. Go to Preferences -> Key Bindings. Type "Update Frames" on the top. You'll see two appear. You'll want the bottom one (it will be the one without a keyboard shortcut assigned.)

Assign it to ⌘= or anything else you like.

Life changed.

enter image description here enter image description here

  • Just for anyone reading, with Xcode 8.3. The popup menu command no longer exists. The menu bar command Editor -> Update Frames does work. However there's a bug, the default key binding on that does not work. If you add a custom key combo, that custom key combo does work.
like image 71
ZaBlanc Avatar answered Oct 21 '22 16:10

ZaBlanc