In this course, I've developed key skills in handling data within iOS apps using Core Data, interfacing with REST APIs, and managing user interactions. This README briefly outlines the Core Data functions implemented in the final project for the Little Lemon app.
- Purpose: Fetches the food menu via a REST API.
- Method: Uses
URLSession
for asynchronous data retrieval.
- Purpose: Decodes JSON data into
MenuItem
structs. - Method: Implements
JSONDecoder
and the Codable protocol.
- Purpose: Stores items in Core Data, checking for duplicates.
- Method: Uses a loop with
dishExists
checks and saves new entries.
- Purpose: Fetches and sorts dishes based on user input.
- Method: Applies
NSPredicate
for filtering andNSSortDescriptor
for sorting.
- Purpose: Displays a confirmation alert on selecting a dish.
- Method: Triggered by user interaction with UI elements.