使用Touchesbegan一次

时间:2014-11-01 12:23:31

标签: swift touchesbegan touchesmoved

我有一个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


}

感谢。

0 个答案:

没有答案