Skip to content

Instantly share code, notes, and snippets.

@monday8am
Created April 1, 2018 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monday8am/7eda7e7873147f6315473105d0345557 to your computer and use it in GitHub Desktop.
Save monday8am/7eda7e7873147f6315473105d0345557 to your computer and use it in GitHub Desktop.
Delivery state described in Swift
enum DeliveryState: StateType {
case notStarted
case settingUp(appId: AppId,
serviceId: ServiceId,
description: ServiceDescription? = null)
case going(progres: DeliveryProgress)
case idle(reason: Idle)
case failed(error: Error)
case finished(status: ServiceStatus)
enum Idle {
case waitingForConnection
case waitingForServerResponse
case waitingForNetworkConnection
case waitingForReconnect (deviceId: DeviceId)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment