BolusProgressViewStyle.swift 757 B

123456789101112131415161718192021
  1. import SwiftUI
  2. public struct BolusProgressViewStyle: ProgressViewStyle {
  3. public func makeBody(configuration: LinearProgressViewStyle.Configuration) -> some View {
  4. ZStack {
  5. Circle()
  6. .stroke(lineWidth: 6.0)
  7. .opacity(0.3)
  8. .foregroundColor(.secondary)
  9. .frame(width: 16, height: 16)
  10. Circle()
  11. .trim(from: 0.0, to: CGFloat(configuration.fractionCompleted ?? 0))
  12. .stroke(style: StrokeStyle(lineWidth: 6.0, lineCap: .round, lineJoin: .round))
  13. .foregroundColor(.insulin)
  14. .rotationEffect(Angle(degrees: -90))
  15. .frame(width: 16, height: 16)
  16. }.frame(width: 30, height: 30)
  17. }
  18. }