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.
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
?