IBDesignable view causes endless rebuilding

I was ALSO still having this issue Xcode 9.3 even after moving all IBDesignables and IBInspectables to a separate framework (and clean all, kill derived data). IB would continue to rebuild the main target and its dependencies.

The solution I found here https://www.e-learn.cn/content/wangluowenzhang/307740 solved it:

  1. remove all @IBDesignable and @IBInspectable
  2. clean all, clear derived data, close Xcode
  3. reopen Xcode, force IB to rebuild with no IBDesignables (Editor -> RefreshAllViews should be greyed out not)
  4. close Xcode
  5. add all @IBDesignable and @IBInspectable back
  6. reopen Xcode
  7. RefreshAllViews should be available, click it.
  8. voila, IB never only rebuilds framework from now on

Clearly there was something funky cached in Xcode that cleanall/killing derived data didn't wipe.


I'm wonder if this designable view class is part of the current target. In WWDC 2014 video What's New in Interface Builder, in the Live Views demonstration, they describe that the first step is to ensure that the designable class is in a separate custom framework target. That video demonstrates the process for creating this custom framework target within the project.

If that's not issue. I'd suggest cleaning your project ("Clean" on "Product" menu) and rebuilding just the custom framework target to make sure that's ok before you try doing anything in IB, itself. Bottom line, make sure that the framework can be built without incident. If the problem still persists after doing that, I'd take it to the next level and (a) find the Xcode derived data folder; (b) quit Xcode; (c) clear the derived data folder, (d) restart Xcode, and (e) trying building the framework target again.

Edit:
Above link seems to be dead. Video can be downloaded directly from: http://devstreaming.apple.com/videos/wwdc/2014/411xx0xo98zzoor/411/411_hd_whats_new_in_interface_builder.mov?dl=1

There is also a github gist with links to all the 2014 material: https://gist.github.com/jianpx/eea1e938d5868e980b11


I was still having this issue (in Xcode 8.3.3) even after moving my IBDesignable classes into a separate framework. What worked for me was to open the offending Xib file, uncheck Editor > Automatically Refresh Views, and then restart Xcode.