SettingsPresentationMode.swift 886 B

12345678910111213141516171819202122232425262728
  1. //
  2. // SettingsPresentationMode.swift
  3. // LoopKitUI
  4. //
  5. // Created by Anna Quinlan on 7/21/20.
  6. // Copyright © 2020 LoopKit Authors. All rights reserved.
  7. //
  8. /// Represents the different modes that settings screens might be represented in
  9. public enum SettingsPresentationMode {
  10. /// Presentation is in the onboarding acceptance flow
  11. case acceptanceFlow
  12. /// Presentation is under the settings ("gear icon") screen
  13. case settings
  14. }
  15. extension SettingsPresentationMode {
  16. /// Text for the button at the bottom of the settings screen
  17. var buttonText: String {
  18. switch self {
  19. case .acceptanceFlow:
  20. return LocalizedString("Confirm Setting", comment: "The button text for confirming the setting")
  21. case .settings:
  22. return LocalizedString("Save", comment: "The button text for saving on a configuration page")
  23. }
  24. }
  25. }