9

After I add @IBDesignable to a view controller,

import UIKit

@IBDesignable
class IvCalcViewController: UIViewController {
  // ...
}

the following error shows up in Xcode 7.2 (7C68):

file:///.../Base.lproj/Main.storyboard: error: IB Designables: Failed to update auto layout status: The agent raised a "CALayerInvalidGeometry" exception: CALayer position contains NaN: [207 nan]

I can still run the app in Simulator when the error is there.

enter image description here

When I click on the error, Xcode jumps to the ViewController in StoryBoard but does not highlight what's wrong.

How can I clear the error?

p.s. I have removed all auto-layout constrains from the StoryBoard already...

Update: one way to clear the error:

  • remove all @IBDesignable from the source
  • close the project
  • re-open the project

So the question becomes: are there some minimum auto-layout requirements to meet when using @IBDesignable?

ohho
  • 50,879
  • 75
  • 256
  • 383
  • Did you solve your problem? I am coming across something similar when I try to make [this](http://stackoverflow.com/a/34524346/3681880) @IBDesignable, although I think my problem may be related to loading the layout from an xib file. – Suragch Dec 30 '15 at 07:34

0 Answers0