Stevia
Stevia copied to clipboard
LastBaseline crash
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.