Search code examples
iosxcode-storyboardibdesignable

IB_DESIGNABLE makes Xcode stop responding when leaving storyboard


Xcode 6 introduced IB_DESIGNABLE and IBInspectable. I'm quite a late bloomer, and discovered this 3 days ago. I thought it would be handy, when creating or using custom view, but I do have a huge problem: IB_DESIGNABLE makes Xcode stop working.

I design the custom view, and it appears properly, as intended, in the storyboard. Hooray, I'm happy! But then I leave the storyboard to edit another file, and Xcode stops responding, and the mouse becomes a spinning wheel that spins like a mad man, never ending. (I let it spin for an hour).

I'm using Xcode 6.3 As soon as I remove the IB_DESIGNABLE property from the view, Xcode behave properly (but no more preview, no more using the intrinsicContentSize for constraint and stuff). I feel like once again, Apple is whistling in the wind and delivering half baked tools... I tried to write the class in Objective-C and Swift, same result.

I have the same problem with SZTextView (https://github.com/glaszig/SZTextView)

Did anyone face the same issue and could guide be toward a solution?


Solution

  • It looks that this issue is a known bug with Xcode 6.3. There is no workaround, apart from waiting for Apple to correct it somehow.

    See here for more discussion about it: Xcode 6.3 freezes/hangs after opening XIB file

    UPDATE : Xcode 6.3.1 seems to fix the problem. No more stalling/crash when using IB_DESIGNABLE