Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only sending KVO notifications if the open state changes.

  • Loading branch information...
commit 215f89c48534cee1816ac32e49767d3801b7787f 1 parent c444347
@matej authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 MBPullDownController/MBPullDownController.m
View
9 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;
Please sign in to comment.
Something went wrong with that request. Please try again.