Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LastBaseline crash #159

Open
NikKovIos opened this issue May 31, 2021 · 0 comments
Open

LastBaseline crash #159

NikKovIos opened this issue May 31, 2021 · 0 comments

Comments

@NikKovIos
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant