Post

Replies

Boosts

Views

Activity

Reply to Not able to decode JSON
Thank you for the help. When I did the do-catch the code is now functioning. do { let loadedData = try decoder.decode(T.self, from: data) return loadedData } catch { print("Decoding error: \(error)") fatalError("Could not decode \(file) from bundle.") }
Topic: App & System Services SubTopic: General Tags:
Jul ’23
Reply to No exact matches in call to instance method 'appendInterpolation' issue
private var ads: [AdInfo] = AdInfo.allAds the other part to that is : struct AdInfo: Codable { var aid, bname, bcity: String? var bstate: Bstate? var distance: String? var cangap: String? var vip: Int? var photo: [String: String]? var adsTitle, adsMsg, status: String? var urgentAdsHTML: [AdInfo]? enum CodingKeys: String, CodingKey { case aid, bname, bcity, bstate, distance, cangap, vip, photo case adsTitle = "ads_title" case adsMsg = "ads_msg" case status, urgentAdsHTML } static let allAds: [AdInfo] = Bundle.main.decode(file: "sanantoniotx.json") static let sampleAd: AdInfo = allAds[0] }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’23
Reply to Argument passed to call that takes no arguments help
The line that says guard let data = try? Data(contentsOf: url) else { I might be possible that using data wont work.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Argument passed to call that takes no arguments help
nvm, I looked through my code and found the issue, I had "Data" as one of my structs. Thank you for the help though!
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Not able to decode JSON
Thank you for the help. When I did the do-catch the code is now functioning. do { let loadedData = try decoder.decode(T.self, from: data) return loadedData } catch { print("Decoding error: \(error)") fatalError("Could not decode \(file) from bundle.") }
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to No exact matches in call to instance method 'appendInterpolation' issue
private var ads: [AdInfo] = AdInfo.allAds the other part to that is : struct AdInfo: Codable { var aid, bname, bcity: String? var bstate: Bstate? var distance: String? var cangap: String? var vip: Int? var photo: [String: String]? var adsTitle, adsMsg, status: String? var urgentAdsHTML: [AdInfo]? enum CodingKeys: String, CodingKey { case aid, bname, bcity, bstate, distance, cangap, vip, photo case adsTitle = "ads_title" case adsMsg = "ads_msg" case status, urgentAdsHTML } static let allAds: [AdInfo] = Bundle.main.decode(file: "sanantoniotx.json") static let sampleAd: AdInfo = allAds[0] }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to No exact matches in call to instance method 'appendInterpolation' issue
well when i tried both of the codes to test, It crashed xcode..
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to MapKit UI - Marker / Protocol help
Did you end up solving the issue?
Replies
Boosts
Views
Activity
Jan ’24
Reply to NavigationView and ScrollView = Extra Padding?
I found that wrapping the NavigationView around the VStack solves it
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’24