|
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 |
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and more!
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.