Guys J'ai le code suivant pour produire un bezierpathAnimer roundedRect avec CoreAnimation
firstLine.path = UIBezierPath(roundedRect: CGRect(x: frameSize.width/2.2, y: frameSize.height/2.6, width: 4, height: 4), cornerRadius: 10).cgPath
J'essaie d'animer le firstLine en le déplaçant vers la droite de l'écran par la valeur x et revenir à la position initiale. Mais je ne sais pas quoi utiliser pour le keyPath dans l'animation.
let animation = CABasicAnimation(keyPath: "??")
animation.toValue = // this should be the position to move?
animation.duration = 0.5 // duration of the animation
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) // animation curve is Ease Out
animation.fillMode = kCAFillModeBoth // keep to value after finishing
animation.isRemovedOnCompletion = false // don't remove after finishing
animation.autoreverses = true
animation.repeatCount = HUGE
que quelqu'un peut me aider sur ce :)
La keypath position est en quelque sorte ne fonctionne pas pour bezierpath. – Reshad
@Reshad Pouvez-vous ajouter le code que vous utilisez pour déplacer le Bézier? –