-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trying to do animation after fadeout completion but not work. #4
Comments
Had the same problem. What is happening is that Essentially you are erasing the block before it gets used. I took out the line above, and it works fine for me. You can handle the NULLing of the completion block yourself if need be. Hope this helps |
@IchabodDee I should probably nullify the completion when the shine or fadeOut methods (the ones without completion block) got called instead of after the completion block is called. What do you think? |
@zipme That is a good way to handle it. Essentially what you are trying to avoid is the scenario where you call shine or fadeOut and a completion block is used when it shouldn't be. setting self.completion to NULL when shine or fadeOut are called should do the trick. Thanks a ton for the Shine Label it saved me a bunch of time for sure. When my app hits the app store I'll link it over so you can see your code at work. Take care zipme |
Thanks so much! And good luck with your app! |
I want to create the animation that the label shines first, then followed by fading out the text and then switching the image in an imageview and after the completion of switching image I want to shine some other text, and repeat this process forever. Yet I do not know why the completion block for fadeout is not called.
Here is some of my code:
{
if (self.shineLabel.isVisible)
{
//NSLog(@"is visible");
[self.shineLabel fadeOutWithCompletion:^{
NSLog(@"text = %@",self.shineLabel.text);
[self changeText];
[self startAnimatingBackground];
[self.shineLabel shineWithCompletion:^{
[self Animate];
}];
//[self startAnimatingBackground];
}];
}
else
{
[self.shineLabel shineWithCompletion:^{
[self Animate];
}];
}
}
{
NSLog(@"start animating background");
UIImage *image = [self.imageArray objectAtIndex:(count % [self.imageArray count])];
[UIView transitionWithView:self.imageLayer1
duration:2.0f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
self.imageLayer1.image = image;
}completion:^(BOOL finished)
{
NSLog(@"finished");
count++;
}];
}
The text was updated successfully, but these errors were encountered: