Created
May 1, 2020 23:29
-
-
Save eMdOS/92545ff34098dc3d33576252f842a118 to your computer and use it in GitHub Desktop.
Medium: Extending the Swift's Result type
This file contains 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
let url: URL = "https://api.themoviedb.org/3/movie/now_playing?api_key=\(apiKey)&page=1" | |
URLSession.shared | |
.dataTaskPublisher(for: url) | |
.map(\.data) | |
.decode(type: MoviesPage.self, decoder: JSONDecoder()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment