Skip to content

Instantly share code, notes, and snippets.

@gliubc
Last active June 14, 2018 03:19
Show Gist options
  • Save gliubc/44c15729d1c13954c7d8f5cb6cbe9ee0 to your computer and use it in GitHub Desktop.
Save gliubc/44c15729d1c13954c7d8f5cb6cbe9ee0 to your computer and use it in GitHub Desktop.
animateWithDuration
[UIView animateWithDuration:0.3f animations:^{
self.tabMenuIndicator.frame = CGRectMake(200, 0, 50, 5);
}];
- (void)showFilter {
self.mainVC.viewFilterMask.hidden = NO;
self.mainVC.viewFilterMask.alpha = 0;
self.mainVC.constraintFilterLeadingInvisible.active = NO;
self.mainVC.constraintFilterLeadingVisible.active = YES;
[UIView animateWithDuration:0.4 animations:^{
[self.mainVC.view layoutIfNeeded];
self.mainVC.viewFilterMask.alpha = 1;
}];
}
- (void)hideFilter {
self.mainVC.constraintFilterLeadingVisible.active = NO;
self.mainVC.constraintFilterLeadingInvisible.active = YES;
[UIView animateWithDuration:0.4 animations:^{
[self.mainVC.view layoutIfNeeded];
self.mainVC.viewFilterMask.alpha = 0;
} completion:^(BOOL finished) {
self.mainVC.viewFilterMask.hidden = YES;
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment