MockService+UI.swift 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // MockService+UI.swift
  3. // MockKitUI
  4. //
  5. // Created by Darin Krauss on 5/17/19.
  6. // Copyright © 2019 LoopKit Authors. All rights reserved.
  7. //
  8. import SwiftUI
  9. import LoopKit
  10. import LoopKitUI
  11. import MockKit
  12. import HealthKit
  13. extension MockService: ServiceUI {
  14. public static var image: UIImage? {
  15. return UIImage(systemName: "icloud.and.arrow.up")
  16. }
  17. public static var providesOnboarding: Bool { return false }
  18. public static func setupViewController(currentTherapySettings: TherapySettings, preferredGlucoseUnit: HKUnit, chartColors: ChartColorPalette, carbTintColor: Color, glucoseTintColor: Color, guidanceColors: GuidanceColors, insulinTintColor: Color) -> (UIViewController & ServiceSetupNotifying & CompletionNotifying)? {
  19. return ServiceViewController(rootViewController: MockServiceTableViewController(service: MockService(), for: .create))
  20. }
  21. public func settingsViewController(currentTherapySettings: TherapySettings, preferredGlucoseUnit: HKUnit, chartColors: ChartColorPalette, carbTintColor: Color, glucoseTintColor: Color, guidanceColors: GuidanceColors, insulinTintColor: Color) -> (UIViewController & ServiceSettingsNotifying & CompletionNotifying) {
  22. return ServiceViewController(rootViewController: MockServiceTableViewController(service: self, for: .update))
  23. }
  24. public func supportMenuItem(supportInfoProvider: SupportInfoProvider, urlHandler: @escaping (URL) -> Void) -> AnyView? {
  25. return nil
  26. }
  27. }