Skip to content

Instantly share code, notes, and snippets.

@fassko
Created July 30, 2019 08:03
Show Gist options
  • Save fassko/9dca0b718136506ac7d261db333c2722 to your computer and use it in GitHub Desktop.
Save fassko/9dca0b718136506ac7d261db333c2722 to your computer and use it in GitHub Desktop.
Receiving messages with Websocket iOS13
webSocketTask.receive { result in
switch result {
case .failure(let error):
print("Error in receiving message: \(error)")
case .success(let message):
switch message {
case .string(let text):
print("Received string: \(text)")
case .data(let data):
print("Received data: \(data)")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment