Mercurial > public > lazybear
comparison LazyBear/Global functions/ParseJSON.swift @ 417:5f21f7c23c5e
Add comments and clean code
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Fri, 11 Jun 2021 11:37:42 +0200 |
parents | 5ccceb527178 |
children |
comparison
equal
deleted
inserted
replaced
416:1662a41e2c1a | 417:5f21f7c23c5e |
---|---|
6 // | 6 // |
7 | 7 |
8 import Foundation | 8 import Foundation |
9 | 9 |
10 | 10 |
11 /* | |
12 Read JSON File | |
13 */ | |
11 func parseJSON<T: Decodable>(_ filename: String) -> T { | 14 func parseJSON<T: Decodable>(_ filename: String) -> T { |
12 let data: Data | 15 let data: Data |
13 | 16 |
14 guard let file = Bundle.main.url(forResource: filename, withExtension: nil) | 17 guard let file = Bundle.main.url(forResource: filename, withExtension: nil) |
15 else { | 18 else { |