ServiceNavigationController.swift 992 B

123456789101112131415161718192021222324252627282930313233
  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. import UIKit
  10. open class ServiceNavigationController: UINavigationController, ServiceOnboarding, CompletionNotifying {
  11. public weak var serviceOnboardingDelegate: ServiceOnboardingDelegate?
  12. public weak var completionDelegate: CompletionDelegate?
  13. public func notifyServiceCreated(_ service: Service) {
  14. serviceOnboardingDelegate?.serviceOnboarding(didCreateService: service)
  15. }
  16. public func notifyServiceOnboarded(_ service: Service) {
  17. serviceOnboardingDelegate?.serviceOnboarding(didOnboardService: service)
  18. }
  19. public func notifyServiceCreatedAndOnboarded(_ service: ServiceUI) {
  20. notifyServiceCreated(service)
  21. notifyServiceOnboarded(service)
  22. }
  23. public func notifyComplete() {
  24. completionDelegate?.completionNotifyingDidComplete(self)
  25. }
  26. }