What is the quickest way to clean up all warnings in all XIB / Storyboard files In Xcode 7

孤者浪人 提交于 2020-01-02 10:32:19

问题


In Xcode, whenever I see warnings (usually about misplaced elements) appear in the XIB / Storyboard, I have to:

  1. Select the container (Usually the containing view controller or the top most view)
  2. From the Xcode menu select Editor -> Resolve Auto Layout Issues -> All views in <container name> -> Appropriate action ( For instance: Update frames) to resolve the issues.

The above method takes requires steps and a bit time consuming to me. It would be great if I could: - Resolve all warnings for ALL view controllers in a storyboard/XIB file - Even better resolve ALL warnings of all storyboard/XIB files available in the project

If you have any idea please advise. Thanks!


回答1:


After trying many ways, I think for now this is the quickiest method I know:

  1. Open the Xcode issue navigator (see the image below)
  2. Type frame for in the text box at the bottom to filter layout issues.
  3. Click on the warning one by one and press Command + Option + =.

That's it!

Personally I also found out that doing this way can significantly shorten the time to click through all warnings:

  1. Use the left hand's index finger to press left Command key
  2. Use the left hand's middle finger to press left option (or alt) key
  3. Using right hand's pinky to press = key
  4. Use right hand's thumb to click on the touch pad, BUT don't move it on the touch pad so that I can always click on the FIRST warning



来源:https://stackoverflow.com/questions/32630880/what-is-the-quickest-way-to-clean-up-all-warnings-in-all-xib-storyboard-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!