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

Calculate constraint update based on converted rect. #2

Open
markst opened this issue Dec 15, 2014 · 1 comment
Open

Calculate constraint update based on converted rect. #2

markst opened this issue Dec 15, 2014 · 1 comment

Comments

@markst
Copy link
Contributor

markst commented Dec 15, 2014

    UIView * superview = [(UIView *)self.firstItem superview];
    CGRect keyboardFrame = [superview.window convertRect:keyboardFrame toView:superview.superview];
    CGFloat inset = superview.frame.origin.y + superview.frame.size.height - keyboardFrame.origin.y;
@ezescaruli
Copy link
Contributor

@markst This could be of your interest: 885d7fb

I'm basically doing [superview convertRect:superview.bounds toView:nil], to use that view's frame relative to the current window, before subtracting CGRectGetMinY(endFrame).

My logic behind that is that endFrame is always relative to the current window, so the subtraction should use two rects in the same coordinate system.

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

2 participants