|
I've got a program that trys to download the picture of the day from NASA. I get download failed, but I know the URL works - here is the output I get
Any ideas what it all means? Here is ContentView.swift
and here is Picture.swift
|
|
If I just put the url string into sarafi it returns some valid JSON. I think the error is that I am expecting an array of records to be returned, but the API only ever returns a single record. Having said that I am unsure how to fix it. |
|
Change:
to:
|
|
thanks Rooster, turns out there were a few other things wrong, but you certainly put me on the right track. |
|
PS this warning
can be silenced by going to the Info tab on Targets then under Application Scene Manifest add row Scene Configuration |
SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.