0

while i handle an action in touchesMoved my CADisplayLink Animation is paused. is there a possibility to run my CADisplayLink Animation in the background? In moveBigPoints() i move all selected (Big-)Points of an bezier path with my finger touch... while i do that, CADisplayLink Animation is paused...

override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?){

    if ((animated == false || animationIsPaused == true) && fourFingersIsOn == false) {
        view.isMultipleTouchEnabled = false

        //test if there are bigPoints:
        if(allLinesCounterActual >= 0 &&  (draggedPointIndex != nil)) {
                if(bigPointsBuffer.contains(allLines[allLinesCounterActual].linePoints[draggedPointIndex!])) {
                    thereAreBigPoints = true
                }

        }
        //action if there are bigPoints:
        if(drawOrMove.selectedSegmentIndex == 1 && doubleTap == false && thereAreBigPoints == true) {

            bigPointsHaveMoved = true

            for touch in touches {
                var localPointBuffer = CGPoint()
                if moveBigPointsFirst == false {
                    localPointBuffer = firstLocalPoint
                    moveBigPointsFirst = true
                } else {
                    localPointBuffer = localPointBigPoints
                }
                localPointBigPoints = touch.location(in: view)
                var translation = CGPoint()
                translation.x = localPointBigPoints.x - localPointBuffer.x
                translation.y = localPointBigPoints.y - localPointBuffer.y
                moveBigPoints(translation: translation)
            }
        }
schaf
  • 1
  • 2

0 Answers0