IB Designables: Failed to update auto layout status: The agent raised a "CALayerInvalidGeometry" exception
Asked Answered
A

0

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?

Aquamanile answered 15/12, 2015 at 3:26 Comment(1)
Did you solve your problem? I am coming across something similar when I try to make this @IBDesignable, although I think my problem may be related to loading the layout from an xib file.Teetotal

© 2022 - 2024 — McMap. All rights reserved.