Stevia icon indicating copy to clipboard operation
Stevia copied to clipboard

LastBaseline crash

Open NikKovIos opened this issue 3 years ago • 0 comments

navigationBarBgV = UIView()
view.sv(navigationBarBgV)
navigationBarBgV.LastBaseline == view.safeAreaLayoutGuide.Top

cause a crash

*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to activate constraint with anchors (null) and (null) because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.'

But

navigationBarBgV.lastBaselineAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true

works like a charm.

NikKovIos avatar May 31 '21 08:05 NikKovIos