CBPeripheralState.swift 862 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // CBPeripheralState.swift
  3. // Naterade
  4. //
  5. // Created by Nathan Racklyeft on 3/5/16.
  6. // Copyright © 2016 Nathan Racklyeft. All rights reserved.
  7. //
  8. import CoreBluetooth
  9. extension CBPeripheralState {
  10. // MARK: - CustomStringConvertible
  11. public var description: String {
  12. switch self {
  13. case .connected:
  14. return LocalizedString("Connected", comment: "The connected state")
  15. case .connecting:
  16. return LocalizedString("Connecting", comment: "The in-progress connecting state")
  17. case .disconnected:
  18. return LocalizedString("Disconnected", comment: "The disconnected state")
  19. case .disconnecting:
  20. return LocalizedString("Disconnecting", comment: "The in-progress disconnecting state")
  21. @unknown default:
  22. return "Unknown: \(rawValue)"
  23. }
  24. }
  25. }