From 9803f04a788b6aca06ac42245ade1556f555e8ca Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 21 May 2020 16:21:19 -0400 Subject: [PATCH] current --- .../Atomic/Atoms/Views/LoadingSpinner.swift | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift index 74eeb2dc..3a00df8d 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift @@ -44,9 +44,12 @@ open class LoadingSpinner: View { layer.fillColor = nil layer.strokeColor = strokeColor.cgColor layer.lineWidth = lineWidth - layer.lineCap = .butt + layer.lineCap = .round layer.speed = speed - layer.path = UIBezierPath(ovalIn: bounds.insetBy(dx: lineWidth / 2, dy: lineWidth / 2)).cgPath + let halfWidth = lineWidth / 2 + let radius = (bounds.width - lineWidth) / 2 + layer.path = UIBezierPath(arcCenter: CGPoint(x: radius + halfWidth, y: radius + halfWidth), radius: radius, startAngle: -CGFloat.pi / 2, endAngle: 2.5 * CGFloat.pi, clockwise: true).cgPath + } //-------------------------------------------------- @@ -79,6 +82,25 @@ open class LoadingSpinner: View { } } + // I like this +// Pose(delay: 0.0, start: 0.000, length: 0.75), +// Pose(delay: 0.7, start: 0.500, length: 0.55), +// Pose(delay: 0.5, start: 1.000, length: 0.35), +// Pose(delay: 0.4, start: 1.500, length: 0.4), +// Pose(delay: 0.3, start: 1.875, length: 0.25), +// Pose(delay: 0.3, start: 2.250, length: 0.4), +// Pose(delay: 0.4, start: 2.600, length: 0.55), +// Pose(delay: 0.4, start: 3.000, length: 0.7) + +// Pose(delay: 0.0, start: 0.000, length: 0.7), +// Pose(delay: 0.7, start: 0.500, length: 0.5), +// Pose(delay: 0.6, start: 1.000, length: 0.3), +// Pose(delay: 0.5, start: 1.500, length: 0.2), +// Pose(delay: 0.4, start: 1.875, length: 0.2), +// Pose(delay: 0.3, start: 2.250, length: 0.3), +// Pose(delay: 0.2, start: 2.600, length: 0.5), +// Pose(delay: 0.2, start: 3.000, length: 0.7) + private func animate() { var time: CFTimeInterval = 0 var times = [CFTimeInterval]()