Skip to content

Instantly share code, notes, and snippets.

@kenshin03
Created May 10, 2013 00:23
Show Gist options
  • Save kenshin03/5551606 to your computer and use it in GitHub Desktop.
Save kenshin03/5551606 to your computer and use it in GitHub Desktop.
hide menu buttons
/*
// expanded
self.expandedMenuButtonFrame = CGRectMake(120.0f, 458.0f, 90.0f, 90.0f);
self.expandedMessengerButtonFrame = CGRectMake(10.0f, 429.0f, 72.0f, 110.0f);
self.expandedLauncherButtonFrame = CGRectMake(124.0f, 306.0f, 72.0f, 110.0f);
self.expandedNotificationsButtonFrame = CGRectMake(240.0f, 429.0f, 72.0f, 110.0f);
// collapsed
self.collapsedButtonsFrame = CGRectMake(124.0f, 430.0f, 72.0f, 110.0f);
*/
- (void) animateHideMenuButtons {
[UIView animateWithDuration:0.2f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.messengerButtonView.frame = self.collapsedButtonsFrame;
self.launcherButtonView.frame = self.collapsedButtonsFrame;
self.notificationsButtonView.frame = self.collapsedButtonsFrame;
self.menuButtonView.frame = self.expandedMenuButtonFrame;
self.launcherButtonView.alpha = 0.0f;
self.notificationsButtonView.alpha = 0.0f;
self.messengerButtonView.alpha = 0.0f;
self.launcherButtonLabel.alpha = 0.0f;
self.notificationsButtonLabel.alpha = 0.0f;
self.messengerButtonLabel.alpha = 0.0f;
} completion:^(BOOL finished) {
self.menuExpanded = NO;
self.launcherButtonView.hidden = YES;
self.notificationsButtonView.hidden = YES;
self.messengerButtonView.hidden = YES;
self.launcherButtonLabel.hidden = YES;
self.notificationsButtonLabel.hidden = YES;
self.messengerButtonLabel.hidden = YES;
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment