Skip to content

Commit

Permalink
fix bug on Xcode 16 - iOS12
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasromanomr committed Nov 29, 2024
1 parent aa98fdb commit e9bab99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ public class SkeletonAnimationBuilder {
let animGroup = CAAnimationGroup()
animGroup.animations = [startPointAnim, endPointAnim]
animGroup.duration = duration
animGroup.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn)
animGroup.repeatCount = .infinity
animGroup.autoreverses = autoreverses
animGroup.isRemovedOnCompletion = false

if #available(iOS 12.0, *) {
animGroup.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn)
} else {
animGroup.timingFunction = CAMediaTimingFunction(controlPoints: 0.42, 0.0, 1.0, 1.0)
}

return animGroup
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ public extension CALayer {
// swiftlint:disable:next force_unwrapping
pulseAnimation.toValue = UIColor(cgColor: backgroundColor!).complementaryColor.cgColor
pulseAnimation.duration = 1
pulseAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
pulseAnimation.autoreverses = true
pulseAnimation.repeatCount = .infinity
pulseAnimation.isRemovedOnCompletion = false

if #available(iOS 12.0, *) {
pulseAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
} else {
pulseAnimation.timingFunction = CAMediaTimingFunction(controlPoints: 0.42, 0.0, 0.58, 1.0)
}
return pulseAnimation
}

Expand Down

0 comments on commit e9bab99

Please sign in to comment.