HTPullToRefresh
HTPullToRefresh copied to clipboard
multiple time recalculate SVPullToRefreshView layout
- (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];
}