Skip to content

Instantly share code, notes, and snippets.

@masliukivskyi
Last active May 3, 2020 20:38
Show Gist options
  • Save masliukivskyi/73f55455d7b138af45a6392cbfffcf0f to your computer and use it in GitHub Desktop.
Save masliukivskyi/73f55455d7b138af45a6392cbfffcf0f to your computer and use it in GitHub Desktop.
Basics of Combine
subject
.handleEvents(
receiveSubscription: { (subscription) in
print("Received a subscription: \(subscription)")
}, receiveOutput: { (output) in
print("Received an output: \(output)")
}, receiveCompletion: { (completion) in
switch completion {
case .finished:
print("Finished with success")
case .failure(let error):
print("Finished with an error \(error)")
}
}, receiveCancel: {
print("Received a cancel")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment