Why is setAnimationDidStopSelector discouraged?

In the documentation for apples, I saw the following: setAnimationDidStopSelector:

"Using this method is not recommended in iOS 4.0 and later. If you use block-based animation methods, you can include the end code of your delegates directly inside your block."

I tried to add what I was going to put in the delegate the animation stops inside the animation block, but the animation does not look the same as when I used setAnimationDidStopSelector.

What is the reason for not using setAnimationDidStopSelector?

+3
source share
1 answer

API, Cocoa Touch. , Apple . , , , , " , , setAnimationDidStopSelector - ".

, ? ?

    [UIView animateWithDuration:1.0
        delay: 0.0
        options: UIViewAnimationOptionCurveEaseIn
        animations:^{
             aView.alpha = 0.0;
        }
        completion:^(BOOL finished){
            // Do your setAnimationDidStopSelector stuff here!
        }];
+18

All Articles