Unofficial APOD utilizes Alamofire
to request data from NASA's APOD servers. The response data is returned in JSON format. Unofficial APOD utilizes structs conforming to Swift's Codable
protocol to parse the JSON returns and persists the data in Core Data. Prior to requesting information from NASA's servers, Unofficial APOD first checks to see if it has already retrieved the data before making a network request.
NASA returns a JSON with text data about the image, but no binary data is returned. Unofficial APOD utilizes AlamofireImage
to download the most recent 60 days' worth of non-copywritten images on a background thread and persists them locally to speed up performance for the user.
Copywritten images are not stored on the device. So the user doesn't see an empty screen, the UICircularProgressRing
framework is configured to display the status of the image download.
Giv