ServiceNavigationController.swift 979 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // ServiceNavigationController.swift
  3. // LoopKitUI
  4. //
  5. // Created by Darin Krauss on 5/23/19.
  6. // Copyright © 2019 LoopKit Authors. All rights reserved.
  7. //
  8. import LoopKit
  9. open class ServiceNavigationController: UINavigationController, ServiceOnboarding, CompletionNotifying {
  10. public weak var serviceOnboardingDelegate: ServiceOnboardingDelegate?
  11. public weak var completionDelegate: CompletionDelegate?
  12. public func notifyServiceCreated(_ service: Service) {
  13. serviceOnboardingDelegate?.serviceOnboarding(didCreateService: service)
  14. }
  15. public func notifyServiceOnboarded(_ service: Service) {
  16. serviceOnboardingDelegate?.serviceOnboarding(didOnboardService: service)
  17. }
  18. public func notifyServiceCreatedAndOnboarded(_ service: ServiceUI) {
  19. notifyServiceCreated(service)
  20. notifyServiceOnboarded(service)
  21. }
  22. public func notifyComplete() {
  23. completionDelegate?.completionNotifyingDidComplete(self)
  24. }
  25. }