Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 Storyboard extremely slow to the point of unresponsive

Tags:

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.

like image 818
E. Huckabee Avatar asked Sep 27 '17 13:09

E. Huckabee


People also ask

Why is storyboard that so slow?

If you stuff all view controllers into one storyboard, it will get slow eventually. I suggest one storyboard should have less than 15 view controllers. You can select a few related view controllers, usually inside the same navigation controller, then select Editor > Refactor to Storyboard .

Is storyboard easier than SwiftUI?

Storyboard Advantages over SwiftUIIt is easier to use Storyboard as a beginner . Storyboard consist of Xib and custom View which can be reusable in the projects. It is easier to build an app as there is only drag and drop of the elements of the storyboard.

Should I use storyboards or SwiftUI?

For most new developers coding on iOS 13 or higher, you should learn SwiftUI. If you need to maintain an older code base with Storyboards, you should learn Storyboards.

Can you use both SwiftUI and storyboard?

The answer is YES! Here we will be discussing a simple way to use SwiftUI into our existing project, which already consists of a storyboard.


2 Answers

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.

like image 84
E. Huckabee Avatar answered Sep 24 '22 17:09

E. Huckabee


I had extremely slow only when editing on xib file in Xcode version 10.1. What worked for me was to disable the Source Control under Xcode/Preferences/Source Control and then I checked "Enable Source Control" again and it fixed it.

like image 38
htahmas Avatar answered Sep 21 '22 17:09

htahmas