//移动监听
    override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
        
        let touch : UITouch = touches.first!
        let currentP:CGPoint=touch.locationInView(self)
        let preP:CGPoint=touch.previousLocationInView(self)
        
        let offsetX=currentP.x-preP.x
        let offsetY=currentP.y-preP.y
        
        self.transform=CGAffineTransformTranslate(self.transform, offsetX, offsetY)
        
    }

 

posted on 2016-07-27 21:06  青年程序猿  阅读(1379)  评论(0)    收藏  举报