Mercurial > public > simoleon
diff Simoleon/Helpers/FileHelper.swift @ 160:0c589138a6f3
Implement Conversion Box
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 29 Aug 2021 19:04:34 +0100 |
parents | 84137052813d |
children |
line wrap: on
line diff
--- a/Simoleon/Helpers/FileHelper.swift Sat Aug 28 19:18:50 2021 +0100 +++ b/Simoleon/Helpers/FileHelper.swift Sun Aug 29 19:04:34 2021 +0100 @@ -7,10 +7,8 @@ import Foundation -/* - Decode and read json file - */ -func read<T: Decodable>(json filename: String) throws -> T { + +func readJson<T: Decodable>(from filename: String) throws -> T { let data: Data guard let file = Bundle.main.url(forResource: filename, withExtension: nil) @@ -32,10 +30,7 @@ } } -/* - Read configuration variables from Config.xconfig - */ -func readConfigVariable(withKey: String) -> String? { +func readConfig(withKey: String) -> String? { return (Bundle.main.infoDictionary?[withKey] as? String)? .replacingOccurrences(of: "\\", with: "") }