Created
July 30, 2019 08:03
-
-
Save fassko/9dca0b718136506ac7d261db333c2722 to your computer and use it in GitHub Desktop.
Receiving messages with Websocket iOS13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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