Я пытался свести к минимуму все свои функции в своем приложении, но не могу найти, как сделать эту функцию лучше, может, кто-то намного лучше в этом, чем я?:)
-(void)showRivBoxWithAnimtation:(BOOL)yesno {
if(yesno) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2];
if ([self alpha] > 0) {
[self setAlpha:0.0];
[appDelegate.JSONparser setDelegate:self.delegate]; //Give back the JSONparser to the parent!
} else {
[self setAlpha:1.0];
}
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(clearRivBoxContent:finished:context:)];
[UIView commitAnimations];
} else {
if ([self alpha] > 0) {
[self setAlpha:0.0];
[appDelegate.JSONparser setDelegate:self.delegate]; //Give back the JSONparser to the parent!
} else {
[self setAlpha:1.0];
}
}
}