Ios 如何更改为动画块?

Ios 如何更改为动画块?,ios,animation,Ios,Animation,我想使用块更改下面的代码。 我该怎么做?提前谢谢 -(void) move:(CGPoint) point { [UIView beginAnimations:nil context:CFBridgingRetain(value)]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:viewController]; [UIView setAnimationDidStopSelector

我想使用块更改下面的代码。 我该怎么做?提前谢谢

-(void) move:(CGPoint) point
{
    [UIView beginAnimations:nil context:CFBridgingRetain(value)];
    [UIView setAnimationDuration:0.5];
    [UIView setAnimationDelegate:viewController];
    [UIView setAnimationDidStopSelector:@selector(stop:finished:context:)];
    view.center = view.center + point;
    [UIView commitAnimations];
}

- (void)stop:(NSString *)animationID finished:(NSNumber *)finished context:(void  *)context 
{
     NSNumber *value = (NSNumber *)CFBridgingRelease(context);
    // something        
}
试试这个:

// Init value variable here
NSNumber *value = @1;
[UIView animateWithDuration:0.5 animations:^{
    CGPoint center = view.center;
    center.x += point.x;
    center.y += point.y;
    view.center = center;
} completion:^(BOOL finished) {
    // Access value after animation completion
    NSLog(@"%@", value);
}];

这取决于
stop:finished:context:
的作用。请把代码也贴出来。