Currently I have this code that works fine
[UIView setAnimationDidStopSelector:@selector(animationDone:finished:context:)];
- (void)animationDone:(NSString *)animationID finished:(BOOL)finished context:(void *)context {
// do stuff here
}
Logging the value of animationID gives me a null.
How can I pass value to the @selector?
I tried
[UIView setAnimationDidStopSelec开发者_运维百科tor:@selector(animationDone:@"animation1"finished:context:)];
That gives me an error.
Thanks, Tee
The string passed to the selector is the one you use in this method call:
[UIView beginAnimations:@"your_animation_name_here" context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
// whatever changes here
[UIView commitAnimations];
Afterwards, you can do this:
- (void)animationFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context
{
    if ([animationID isEqualToString:@"your_animation_name_here"])
    {
        // something done after the animation
    }
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论