我的班级有两种方法,每种方法都有一个动画。我的问题是,我可以将这些动画存储在一个数组或其他东西中并通过 beginAnimation:name 引用它们吗?如果是,我该怎么做?
感谢帮助
-(void)hideMenu{
[UIView beginAnimations:@"HIDE_MENU" context:nil];
[UIView setAnimationDuration:0.38];
[UIView setAnimationDelay:0.12];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationBeginsFromCurrentState:YES];
self.frame = CGRectMake(0, -1 * self.frame.size.height, self.frame.size.width, self.frame.size.height);
[UIView commitAnimations];
}
-(void)showMenu{
[UIView beginAnimations:@"SHOW_MENU" context:nil];
[UIView setAnimationDuration:0.38];
[UIView setAnimationDelay:0.12];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationBeginsFromCurrentState:YES];
self.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
[UIView commitAnimations];
}
-(void)handleShowMenu:(NSNotification*)note{
[self showMenu];
}
-(void)handleHideMenu:(NSNotification*)note{
[self hideMenu];
}