Permalink
Browse files

Only sending KVO notifications if the open state changes.

  • Loading branch information...
1 parent c444347 commit 215f89c48534cee1816ac32e49767d3801b7787f @matej committed Apr 3, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 MBPullDownController/MBPullDownController.m
@@ -145,9 +145,12 @@ - (void)setOpen:(BOOL)open {
}
- (void)setOpen:(BOOL)open animated:(BOOL)animated {
- [self willChangeValueForKey:@"open"];
- _open = open;
- [self didChangeValueForKey:@"open"];
+ if (open != _open) {
+ [self willChangeValueForKey:@"open"];
+ _open = open;
+ [self didChangeValueForKey:@"open"];
+ }
+
UIScrollView *scrollView = [self scrollView];
CGFloat offset = open ? self.view.bounds.size.height - self.openBottomOffset : self.closedTopOffset;

0 comments on commit 215f89c

Please sign in to comment.