我有一个touchesbegan和一个touchesmoved在屏幕上移动UIImageView。但我想这样做,所以我不能开始在屏幕上移动,然后使用touchesbegan去对面。我不想让自己的方式走到另一边。这甚至可能吗?这是我的代码:
override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
var touch : UITouch! = touches.anyObject() as UITouch
location = touch.locationInView(self.view)
Player.center = location
}
override func touchesMoved(touches: NSSet, withEvent event: UIEvent) {
var touch : UITouch! = touches.anyObject() as UITouch
location = touch.locationInView(self.view)
Player.center = location
}
感谢。