0

I set a CABasicAnimation toValue und fromValue.

let translateAnimation = CABasicAnimation(keyPath: "transform.translation.x")
let targetFrame = CGRectOffset(runnerContentView.frame, targetX, 0);
let sourcePoint = CGPoint(x: startingvalue, y: 0)
translateAnimation.toValue = NSValue(point: targetFrame.origin)
translateAnimation.fromValue = NSValue(point: sourcePoint)

I need the current position from the CABasicAnimation when i click a Button.

Gazzari
  • 1
  • 3
  • 1
    lookup / access the `presentationLayer`! – luk2302 May 13 '16 at 09:16
  • See this question: http://stackoverflow.com/questions/37102573/cashapelayer-detect-touch-during-animation-swift Instead of getting the path property from the presentation layer, you'll want to get the transform. – Hamish May 13 '16 at 09:23
  • @orignaluser2 can u explain it? – Gazzari May 21 '16 at 10:04

0 Answers0