A SwiftUI application to explore and view detailed information about various desserts. This app uses TheMealDB API to fetch dessert details and present them in a user-friendly interface.
- Fetch and display a list of desserts.
- View detailed information about each dessert, including ingredients and instructions.
- Navigate smoothly between the list view and detail view.
- Handle loading states and errors gracefully.
Watch the demo video to see the app in action:
Screen.Recording.2024-05-24.at.01.11.35.mov
- iOS 14.0+
- Xcode 12.0+
- Swift 5.0+
-
Clone the repository:
git clone https://github.com/saikiran-chatti/meals-app.git cd meals-app
-
Open the project in Xcode:
open Meals_app.xcodeproj
-
Build and run the project on your simulator or device.
- On launch, the app fetches and displays a list of desserts.
- Tap on any dessert to view its detailed information, including ingredients and instructions.
- If there's an error fetching data, an alert will be shown with the error message.
DessertListResponse
: Response model for a list of desserts.Dessert
: Model representing a dessert.MealDetailResponse
: Response model for detailed meal information.MealDetail
: Model representing detailed information about a meal.
DessertListViewModel
: Manages the list of desserts, handles API calls, and manages loading and error states.MealDetailViewModel
: Manages the detailed information of a specific meal.
MealListView
: Displays the list of desserts.MealRowView
: Displays a single row of meal information.MealDetailView
: Displays detailed information about a specific meal.
APIService
: Singleton service for handling API requests to TheMealDB.
This app uses TheMealDB API to fetch dessert data. The following endpoints are used:
filter.php?c=Dessert
: Fetches a list of desserts.lookup.php?i={id}
: Fetches detailed information about a specific meal by its ID.