Crash when pop to navigationItem with titleView

180 Views Asked by At

I've been seeing this crash in logs, but unable to reproduce. It occurs when I pop to previous UIViewController in navigation stack, and that view controller had a custom titleView set. I haven't been able to reproduce the crash myself, and it seems to be dealing with views internal to UINavigationBar. Any ideas?

Fatal Exception: NSGenericException
Unable to activate constraint with anchors <NSLayoutXAxisAnchor:0x2823d3d80 "_UITAMICAdaptorView:0x106d354f0.leading"> and <NSLayoutXAxisAnchor:0x282312640 "UILayoutGuide:0x280134000'TitleView(0x104b96cc0)'.leading"> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.
1

There are 1 best solutions below

1
stoikokolev On

I had a similar problem and solved it by reducing the font size of the TitleView label.