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

Pin an edge of a view to *another* edge of its superview's safe area? #250

Open
denjiz opened this issue Aug 2, 2020 · 1 comment
Open
Assignees

Comments

@denjiz
Copy link

denjiz commented Aug 2, 2020

Is it possible to pin one edge of a view (e.g. .top) to another edge of its superview's safe area (e.g. .bottom)?. I'd like to accomplish this behavior:
someView.topAnchor.constraint(equalTo: superview.safeAreaLayoutGuide.bottomAnchor, constant: -50)

From what I see in the PureLayout API, currently it's possible to pin only to the same edge of the superview's safe area.

@toohotz
Copy link
Member

toohotz commented Sep 28, 2020

A bit late to replying as for some reason I do not get Github notifications but I can see the use case for this with the UILayoutGuide introduced in iOS 11.

Would make a good case to replace the deprecated - (NSLayoutConstraint *)autoPinToTopLayoutGuideOfViewController:(UIViewController *)viewController withInset:(CGFloat)inset related methods in the codebase.

@toohotz toohotz self-assigned this Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants