使用 NSTimer 移动图像的例子?
Example of using NSTimer to move an Image?
任何人都可以提供如何使用 NSTImer 在 Swift 上移动 UIImageView 的示例吗?我意识到使用动画是首选方法,但我无法让它在正确的坐标中平滑移动。这是使用 xcode 7。谢谢
注意!!
我已编辑并回复 Jacob 以进一步解决问题。
如评论中所述,我真的不认为你想为这类事情使用 NSTimer。
你试过了吗:
UIView.animateWithDuration(0.2, animations: {
//update frame of imageView to new desired location
}, completion: {
//
})
任何人都可以提供如何使用 NSTImer 在 Swift 上移动 UIImageView 的示例吗?我意识到使用动画是首选方法,但我无法让它在正确的坐标中平滑移动。这是使用 xcode 7。谢谢
注意!!
我已编辑并回复 Jacob 以进一步解决问题。
如评论中所述,我真的不认为你想为这类事情使用 NSTimer。
你试过了吗:
UIView.animateWithDuration(0.2, animations: {
//update frame of imageView to new desired location
}, completion: {
//
})