|
My code runs and compiles but it doe snot display any content... Any pointers on where to start fault finding The fact that I do not see any content would be much appreciated.
|
|
Check you URL address it is misspelled... In project it is
|
|
That's what happens when you decide to start coding when you are 58! :) |
|
Unfortunately, even after correct my two spelling mistakes, still no joy... import SwiftUI struct Response: Codable { var results: [Result] } struct Result: Codable { var trackID: Int var trackName: String var collectionName: String } struct iTunesAPIView: View { @State private var results = [Result]()
} |
|
You have to pay attention to data you receive from server. If you go over the lesson again you might notice that
you can change it of course but then you have to help Swift to update CodingKeys to decode response. Not sure which lesson covers that. But if you want it to work from the box you HAVE to make sure your property names match those you receive from server. OR to use CodingKeys like so
|
|
Thank you, thank you, thank you. You have taught me that every lower/upper case matters! It all works now, thank you! |
SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.