Mercurial > public > simoleon
changeset 74:bfb959bee6d7
Fromatted code
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Thu, 29 Jul 2021 17:01:15 +0100 |
parents | 2b85d6ed433e |
children | b6f8661300f2 |
files | Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate Simoleon/Functions/NetworkRequest.swift Simoleon/Helpers/SearchBar.swift Simoleon/SimoleonApp.swift |
diffstat | 4 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
Binary file Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/Simoleon/Functions/NetworkRequest.swift Thu Jul 29 10:51:08 2021 +0100 +++ b/Simoleon/Functions/NetworkRequest.swift Thu Jul 29 17:01:15 2021 +0100 @@ -8,11 +8,13 @@ import SwiftUI func networkRequest<T: Decodable>(url: String, model: T.Type, completion: @escaping (_ result: T) -> Void) { + // We take some model data T.Type guard let url = URL(string: url) else { print("Invalid URL") return } + let request = URLRequest(url: url) URLSession.shared.dataTask(with: request) { data, response, error in if let data = data {
--- a/Simoleon/Helpers/SearchBar.swift Thu Jul 29 10:51:08 2021 +0100 +++ b/Simoleon/Helpers/SearchBar.swift Thu Jul 29 17:01:15 2021 +0100 @@ -9,6 +9,7 @@ struct SearchBar: View { var placeholder: LocalizedStringKey + @Binding var text: String var body: some View {
--- a/Simoleon/SimoleonApp.swift Thu Jul 29 10:51:08 2021 +0100 +++ b/Simoleon/SimoleonApp.swift Thu Jul 29 17:01:15 2021 +0100 @@ -11,6 +11,7 @@ @main struct SimoleonApp: App { let persistenceController = PersistenceController.shared + init() { Purchases.configure(withAPIKey: "\(readConfig("PURCHASES_KEY")!)") } @@ -27,3 +28,4 @@ } } } +