- if (self.leftOpen) {
- self.leftOpen = !self.leftOpen;
- for (CSQuickActionsButton *button in [self leftButtons]) {
- button.frame = [self leftFrameForButton:button];
- [button setHidden:!self.leftOpen];
- }
- }
- if (self.rightOpen) {
- self.rightOpen = !self.rightOpen;
- for (CSQuickActionsButton *button in [self rightButtons]) {
- button.frame = [self rightFrameForButton:button];
- [button setHidden:!self.rightOpen];
- }
- }
+ [UIView animateWithDuration:0.25
+ delay:0
+ options:UIViewAnimationOptionCurveEaseOut
+ animations:^(void){
+ for (CSQuickActionsButton *button in [self leftButtons])
+ button.frame = [self leftFrameForButton:button open:NO];
+ self.leftOpen = NO;
+ for (CSQuickActionsButton *button in [self rightButtons])
+ button.frame = [self rightFrameForButton:button open:NO];
+ self.rightOpen = NO;
+ }
+ completion:^(BOOL finished) {
+ for (CSQuickActionsButton *button in [self leftButtons])
+ [button setHidden:YES];
+ for (CSQuickActionsButton *button in [self rightButtons])
+ [button setHidden:YES];
+ }];