reuse and rotate

This commit is contained in:
Kevin G Christiano 2020-07-07 14:52:30 -04:00
parent 53764d363a
commit 027b9c9930

View File

@ -48,6 +48,7 @@ open class LoadingSpinner: View {
override open func layoutSubviews() {
super.layoutSubviews()
//
layer.fillColor = nil
layer.strokeColor = strokeColor.cgColor
layer.lineWidth = lineWidth
@ -63,9 +64,17 @@ open class LoadingSpinner: View {
clockwise: true).cgPath
}
open override func updateView(_ size: CGFloat) {
super.updateView(size)
layer.removeAllAnimations()
animate()
}
public override func reset() {
super.reset()
layer.removeAllAnimations()
heightConstraint?.isActive = false
widthConstraint?.isActive = false
}