CGMManagerUI.swift 983 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // CGMManagerUI.swift
  3. // LoopKitUI
  4. //
  5. // Copyright © 2018 LoopKit Authors. All rights reserved.
  6. //
  7. import LoopKit
  8. import HealthKit
  9. public protocol CGMManagerUI: CGMManager {
  10. /// Provides a view controller for setting up and configuring the manager if needed.
  11. ///
  12. /// If this method returns nil, it's expected that `init?(rawState: [:])` creates a non-nil manager
  13. static func setupViewController() -> (UIViewController & CGMManagerSetupViewController & CompletionNotifying)?
  14. func settingsViewController(for glucoseUnit: HKUnit) -> (UIViewController & CompletionNotifying)
  15. var smallImage: UIImage? { get }
  16. }
  17. public protocol CGMManagerSetupViewController {
  18. var setupDelegate: CGMManagerSetupViewControllerDelegate? { get set }
  19. }
  20. public protocol CGMManagerSetupViewControllerDelegate: class {
  21. func cgmManagerSetupViewController(_ cgmManagerSetupViewController: CGMManagerSetupViewController, didSetUpCGMManager cgmManager: CGMManagerUI)
  22. }