Skip to content
Snippets Groups Projects
Select Git revision
  • 9dcf1f2dab75668671a5f989a7ce2c77421673c6
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

NetworkFollowerStatus.swift

Blame
  • NetworkFollowerStatus.swift 553 B
    public enum NetworkFollowerStatus: Equatable {
      case stopped
      case running
      case stopping
      case unknown(code: Int)
    }
    
    extension NetworkFollowerStatus {
      public init(rawValue: Int) {
        switch rawValue {
        case 0: self = .stopped
        case 2_000: self = .running
        case 3_000: self = .stopping
        case let code: self = .unknown(code: code)
        }
      }
    
      public var rawValue: Int {
        switch self {
        case .stopped: return 0
        case .running: return 2_000
        case .stopping: return 3_000
        case .unknown(let code): return code
        }
      }
    }