Last active
December 9, 2019 08:42
-
-
Save acwright/3ac99c6b62a1dc16ec2a08714e746e48 to your computer and use it in GitHub Desktop.
Introducing Pinball 2
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
| try? URLSession.shared.dataTask(for: endpoint) { (data, response, error) in | |
| // Do something with the response… | |
| } | |
| // Or using Combine… | |
| if #available(OSX 10.15, *) { | |
| let publisher = try? URLSession.shared.dataTaskPublisher(for: endpoint) | |
| // Do something with the Combine Publisher | |
| } else { | |
| // Fallback on earlier versions | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment