I'm trying to return a value in a method that contains an animation block. The code I have below works perfectly fine, but it seems like there should be a better or cleaner way to do it. Is there a better way to do this?
+ (BOOL) flipImageAndTextForView:(UIView *) viewFlipImageAndText IsImageDisplayed:(BOOL) imageFlipDisplayed flipTextView:(UITextView *) textViewDonate flipImage: (UIImageView *)pictureImage{
__block BOOL tempBool;
[UIView transitionWithView:viewFlipImageAndText
duration:0.3f
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^(void) {
if (imageFlipDisplayed)
{
[viewFlipImageAndText bringSubviewToFront:textViewDonate];
tempBool = FALSE;
}
else
{
[viewFlipImageAndText bringSubviewToFront:pictureImage];
tempBool = TRUE;
}
}
completion:^(BOOL finished) {
NSLog(@"Done!");
}];
if(tempBool)
{
return TRUE;
}
else{
return FALSE;
}
}