Xcode 6.3 freezes/hangs after opening XIB file

After upgrading to Xcode 6.3 (release version), Xcode now freeze every time I open a XIB/Storyboard file that includes an IB_DESIGNABLE view that uses a custom font for any projects and includes a custom font (not necessarily to have reference to that font in that XIB/Storyboard). The freeze occurs after opening the .xib file and then attempting to switch to any other file. Xcode hangs and must be force quit.

I have opened a bug report with Apple. (Bug 20483867).

Right now, I have two work arounds.

  1. Download and use Xcode 6.2 from Apple.
  2. Remove the IB_DESIGNABLE tags from the custom view header files.

This is likely an Apple bug, but does anyone have a better work around or solution?


Solution 1:

I've already suggested an edit for a more accurate description.

It only happens when your project contains a custom font. It'll freeze just by visiting any Storyboard/XIB that contains an IBDesignable custom view, not even referencing to that font in your Storyboard/XIB.

My workaround is to use have an older version of Xcode also installed (Xcode 6.3 beta or Xcode 6.2) and use that to update your Interface Builder files, and never open it in 6.3. open those Storyboard/XIB in a new window in Xcode with option+shift+click the file in the project tree.

Whenever you encounter the freeze, I use this command to clear the saved state just for that project.

rm -rf YourProject.xcodeproj/project.xcworkspace/xcuserdata

Solution 2:

Xcode 6.3.1 fixes the problem with custom fonts and IB_DESIGNABLE views in a Storyboard. Update via the Mac App Store, and you should be good.

Solution 3:

Response from Apple: Link to Developer Forums on Apple

Thank you all for your reports. We are tracking this on our end and working hard to resolve it. Unfortunately we don't have a great workaround, but here are two options to get you going:

If Xcode is hanging on launch because a storyboard/XIB using a custom font/IBDesignable was previously open: remove the "UserInterfaceState.xcuserstate" file inside the xcodeproj of the project you are opening, it would be at a path like this: My App.xcodeproj/project.xcworkspace/xcuserdata/yourusername.xcuserdatad/UserInterfaceState.xcuserstate

If you really need to edit the storyboard/XIB file containing the custom font with Xcode 6.3:

  1. Make a copy of your storyboard/XIB file as a backup
  2. Open the storyboard/XIB file in a text editor
  3. Remove XML tags named "fontDescription" that reference your custom font, for example: . Removing this tag will revert the font to the standard system font.
  4. Make outlets to the objects using the custom font and at runtime set the font of those objects to your custom font, for example in an override of viewDidLoad or awakeFromNib on your view controller

IMPORTANT NOTE: we never recommend hand editing storyboard/XIB files. However we recognize this issue is preventing many of you from editing your documents and wanted to provide a workaround with the caveat that any hand editing may result in corruption of your document.