私は自分のアプリケーションですべての機能を最小限にしようとしてきましたが、この機能をより良くする方法を見つけることができません。 :)このスニペットをもっときれいにする/よくする/少ない行にするにはどうすればよいですか?
-(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];
}
}
}
はhttp://codereview.stackexchange.comに属していますか? –