如何在swift中动画内容(xcode 6 beta)

Abd*_*ari 4 xcode uianimation ios swift xcode6

我想知道如何用苹果的新语言快速动画.

在目标ci中,将使用以下代码将图像从屏幕顶部移动到结尾:

  [UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
    UIImageView.center = CGPointMake(UIImageView.center.x , UIImageView.center.y + 200);
} completion:^(BOOL finished) {
    [self move];
}]; 
Run Code Online (Sandbox Code Playgroud)

所以questoin是:

  • 我如何使用与上面的代码(obj c)相同的效果在swift中制作动画,我会欣赏一些关于你可以做到的方式的解释.

h0u*_*sni 9

UIView.animateWithDuration(1, delay: 0, options: .CurveLinear, animations: {
    UIImageView.center = CGPointMake(UIImageView.center.x, UIImageView.center.y + 200);
}, completion: {
    (finished: Bool) in
    move();
});
Run Code Online (Sandbox Code Playgroud)

这是怎么回事.