Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode IBDesignablesAgentCocoaTouch loads CPU infinitely?

I have a .xib file with extensive usage of IBDesignable views. As view grown I noticed constant CPU load. Now, my view is really big and when I open it in interface builder, ActivityMonitor show this: . It continues even if I leave .xib file and go to code. The only solution to stop it is to close, then open Xcode and don't open .xib file until it is really necessary. My rough assumption is that Xcode continues compiling my project/views in background to maintain IBDesignable views in actual state.

What should I do to prevent wasting CPU?

If it could make any sense - my mac configuration: MacBook Pro (Retina, 15-inch, Mid 2015), 2.5 GHz Intel Core i7, 16 GB 1600 MHz DDR3

like image 224
Fyodor Volchyok Avatar asked Oct 18 '22 19:10

Fyodor Volchyok


1 Answers

I've got pretty much same issue and solved it by removing all IBDesignable from project, but then I realized that you can just disable Automatically Refresh Views in Editor menu as mentioned here.

Issue returned later on just to some XIBs. The reason was Top Bar in Simulated Metrics on this view, which is really unexpected. Removing all simulated metrics solves CPU loading issue for me.

like image 68
Oleg Kohtenko Avatar answered Oct 20 '22 22:10

Oleg Kohtenko