Permalink
Browse files

Adopts UIExpandingTableViewCell changes in sample application. Closes #2

.
  • Loading branch information...
1 parent 89404c5 commit 71e3296a7cbaca066f933d874feef4685f60806e @OliverLetterer committed Dec 30, 2011
@@ -22,7 +22,4 @@
- (void)setSpinning:(BOOL)spinning;
-- (void)setLoading:(BOOL)loading;
-- (void)setExpansionStyle:(UIExpansionStyle)style;
-
@end
@@ -75,22 +75,28 @@ - (void)setLoading:(BOOL)loading {
[self setSpinning:loading];
}
-- (void)setExpansionStyle:(UIExpansionStyle)style {
- self.accessoryView = self.disclosureIndicatorImageView;
- switch (style) {
- case UIExpansionStyleExpanded:
- self.accessoryView.transform = CGAffineTransformIdentity;
- break;
- case UIExpansionStyleCollapsed:
- self.accessoryView.transform = CGAffineTransformMakeRotation(M_PI);
- break;
-
- default:
- break;
+- (void)setExpansionStyle:(UIExpansionStyle)style animated:(BOOL)animated
+{
+ void(^animationBlock)(void) = ^(void) {
+ self.accessoryView = self.disclosureIndicatorImageView;
+ switch (style) {
+ case UIExpansionStyleExpanded:
+ self.accessoryView.transform = CGAffineTransformIdentity;
+ break;
+ case UIExpansionStyleCollapsed:
+ self.accessoryView.transform = CGAffineTransformMakeRotation(M_PI);
+ break;
+
+ default:
+ break;
+ }
+ };
+
+ if (animated) {
+ [UIView animateWithDuration:0.25f animations:animationBlock];
+ } else {
+ animationBlock();
}
}
-#pragma mark - Memory management
-
-
@end

0 comments on commit 71e3296

Please sign in to comment.