Ios – Xcode 10 Storyboard extremely slow to the point of unresponsive

iosxcode

my Xcode 8.3.3 storyboard is extremely slow almost unresponsive and I don't know what is causing it.

Tried:

Deleting xcuserdata and opening Xcode again.

Opening Xcode on a different project. (It worked fine. It just seems to be this one main.storyboard in this specific project.)

Extracting the main.storyboard file and opening and closing Xcode then putting it back in.

Restarting my Mac (Late 2016. Refurbished with touch-bar. 16GB memory 512GB storage.)

Cleaning the project. (CMD+Shift+K)

All of these have failed and I'm trying to launch my app next week. If this persists, I won't be able to launch and will get behind my schedule.

When I deleted the xcuserdata, I was able to navigate to another .swift file and it works fine. But when I go into storyboard it slows down to basically 1FPS. (I have a MacBook Pro with 16GB of RAM I don't know why it isn't handling this better.)

I'm really fed up with this and all the other things I have tried didn't work.

Best Answer

I found the anwser to my own question for anyone who is having this issue.

  1. clear your xcuserdata and xcworkspace from your Xcode project by clicking show package contents on your xcodeproj file. Move xcuserdata and xcworkspace to the trash.

  2. This allows you to open up your Xcode project again and be able to open storyboard as source code. It resets the last file you had open. To do this right-click (or two-finger click on track-pad) on main.storyboard and choose Open as Source Code

  3. At the top you'll see some code similar or identical to this

<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="OjV-iF-7f7">
<device id="retina5_5" orientation="portrait">
    <adaptation id="fullscreen"/>
</device>
<dependencies>
    <deployment identifier="iOS"/>
    <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
/* delete this here */
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
    <array key="small_pixel.ttf">
        <string>Small-Pixel</string>
    </array>
</customFonts>
<scenes>

Don't panic, you are only looking for one line. No editing needs to be done.

<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/"  
  1. Once you've found it, delete the entire line from the code.

You should now be able to open up the main.storyboard file as the normal interface builder by right-clicking (two-finger click on track-pad) and choosing Open as Interface Builder

(01/07/2020) Reports state this still works for the latest version of Xcode.

Related Topic