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

multiple time recalculate SVPullToRefreshView layout #1

Open
sreshetnyak opened this issue May 18, 2017 · 0 comments
Open

multiple time recalculate SVPullToRefreshView layout #1

sreshetnyak opened this issue May 18, 2017 · 0 comments

Comments

@sreshetnyak
Copy link

  • (void)layoutForVertical
  • (void)layoutForHorizontal

this methods call everytime when change contentSize (when we scroll), it kill performance when calculate label size and set text to title or subtitle label.

  • (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
    if([keyPath isEqualToString:@"contentOffset"])
    [self scrollViewDidScroll:[[change valueForKey:NSKeyValueChangeNewKey] CGPointValue]];
    else if([keyPath isEqualToString:@"contentSize"]) {
    [self layoutSubviews];

      self.frame = [SVPullToRefreshView rectForRefreshViewAtPosition:self.position scrollView:self.scrollView];
    

    }
    else if([keyPath isEqualToString:@"frame"])
    [self layoutSubviews];

}

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