HTPullToRefresh icon indicating copy to clipboard operation
HTPullToRefresh copied to clipboard

multiple time recalculate SVPullToRefreshView layout

Open sreshetnyak opened this issue 8 years ago • 0 comments

  • (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];

}

sreshetnyak avatar May 18 '17 14:05 sreshetnyak