我的情况是我有两个视图,一个视图-> MoveView应该可以在另一个视图-> FrameView 但是当移动内部视图时,可以将其移动到FrameView之外! 希望所有的Views不会打扰您; D!

override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
    var MoveViewLocation = CGPoint()
    super.touchesBegan(touches , withEvent:event)
    if let touch = touches.first as? UITouch {
        MoveViewLocation = touch.locationInView(FrameView)
        MoveView.center = MoveViewLocation
    }
}

  ask by André Kuhlmann translate from so

本文未有回复,本站智能推荐: