Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 9.0.1 Interface Builder 100% CPU opening iOS Storyboard

Last night Xcode automatically updated to Version 9.0.1 (9A1004). Today, I tried to open an existing project and my iOS storyboard file gets stuck with a never ending spinner and Activity Monitor reports Interface Builder using 100% CPU. I have a second MacBook Pro that still has Xcode 9.0.0 and it opens the storyboard without any issue. I'm running macOS High Sierra on both. Anyone else seen this or know of a workaround.

like image 216
Chuck H Avatar asked Oct 25 '17 01:10

Chuck H


3 Answers

Use your storyboard Vary Traits concept and set your device in the storyboard to iPhone X.

This is the quick fix in Xcode version 9.1.

enter image description here

like image 124
Shamsudheen TK Avatar answered Nov 29 '22 19:11

Shamsudheen TK


I received a response from my bug report with a suggested workaround. The suggestion was to edit the storyboard text and change the value for the translatesAutoresizingMaskIntoConstraints attribute from NO to YES in the applicable toolbar tags in the storyboard.

From:

<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill"
 fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KCx-9L-amg">

To:

<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill"
 fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="YES" id="KCx-9L-amg">

I have two storyboard files in my project and this does solve the problem with both of them.

like image 30
Chuck H Avatar answered Nov 29 '22 19:11

Chuck H


I FOUND A FIX!! I have been struggling with this for WEEKS and it has been SO frustrating. Tonight I had an epiphany! From what I have noticed and read, the issue seems to be caused by a massive amount of over-building, particularly if you have IBDesignables in your storyboard like I do. So I thought, 'what if I use Apple's new build system they announced this summer?'

In Xcode, go to File > Project Settings. Then change the Build System from "Standard Build System" to "New Build System". Voila! It has been working just like it used to! Hopefully it is not just a temporary fix like some of the others I have seen. So far it seems amazing.

I also am using Xcode 9.0 as an extra precaution that I downloaded from here: https://developer.apple.com/download/more/

like image 23
eschos24 Avatar answered Nov 29 '22 19:11

eschos24