我正在尝试将图像从滚动条视图移动到屏幕上的其他点。当我在滚动视图外部(名为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
}}