Last active
October 30, 2019 12:13
-
-
Save vasilevkin/28fcb85804bab26cfed4fa103724cd8b to your computer and use it in GitHub Desktop.
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
func loadArticles() throws -> [Article] { | |
let decoder = JSONDecoder() | |
return try files.map { file in | |
let data = try file.read() | |
let article = try decoder.decode(Article.self, from: data) | |
return article | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment