在滚动条视图中未检测到触摸位置

时间:2015-11-30 17:57:32

标签: ios swift location touch

我正在尝试将图像从滚动条视图移动到屏幕上的其他点。当我在滚动视图外部(名为optionScroller)触摸时,它可以工作,但在滚动条视图中没有检测到任何内容。:

override func touchesEnded(touches: Set<UITouch>, withEvent: UIEvent?) {
    self.movingImageView.image = nil


    }

override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
    for touch in (touches ){

        location = touch.locationInView(view)

        movingImageView.center = location

    }}

override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
    for touch in (touches ){

        location = touch.locationInView(self.view)

        movingImageView.center = location

}}

0 个答案:

没有答案