This app fetches and displays information about dog breeds using the Dog API.
- Clone the repository:
git clone [...]
Open the project in Xcode. Run the app in a simulator or device.
The app's codebase is organized into distinct sections, each serving a specific purpose:
-
Utils/: Utilities like
CacheManager.swift
for caching, aiming to improve performance and support offline usage. -
Models/: Defines
DogBreed
and other models, central to our app's data handling. -
ViewModels/: Implements the MVVM pattern with classes such as
DogBreedListViewModel
, ensuring a clear separation between our app's logic and its presentation. -
Views/: SwiftUI views (
DogBreedListView
, etc.) that render the user interface, designed to be both functional and intuitive. -
Services/: The
DogBreedService
class and others encapsulate all networking logic, keeping it separate from UI code. -
BreedAppTests/: Contains unit tests, including mocks and test cases for ViewModels and Services, to verify the app's reliability and behavior.
-
Caching: We opted for
UserDefaults
with a simple cache invalidation strategy to enhance data retrieval speed and offer basic offline functionality. -
Concurrency: Embraced Swift's async/await for network communication, aiming for cleaner and more readable asynchronous code.
-
Architecture: Chose the MVVM design pattern to promote a clean separation of concerns across our app's structure.
We've strived to maintain high code quality by:
- Prioritizing essential features and robust implementations.
- Adhering to Swift and SwiftUI best practices.
- Designing with future extensibility in mind.
- Show a screen with a list of dog breeds images.
- Implemented in
DogBreedListView
.
- Implemented in
- Show a screen with a list of dog breeds when you search by breed name.
- Implemented in
DogBreedSearchView
with live search functionality.
- Implemented in
- Show a screen with the detailed view of a breed.
- Implemented in
DogBreedDetailView
.
- Implemented in
- Use a Tab Bar to switch between the list of dog breeds and the search screen.
- Implemented with a
TabView
at the root level.
- Implemented with a
- Ability to move from a list view into a grid view and take use of pagination.
- Implemented in
DogBreedListView
with a toggle for list/grid view and pagination.
- Implemented in
- Ability to order alphabetically.
- Implemented in
DogBreedListView
with a sort button.
- Implemented in
- Show only the dog breed image and the name in the list/grid view.
- Implemented in
DogBreedView
.
- Implemented in
- Pressing on one of the list elements goes to the details view.
- Implemented with
NavigationLink
inDogBreedListView
andDogBreedSearchView
.
- Implemented with
- Search Bar to search by breed name.
- Implemented in
DogBreedSearchView
with debouncing.
- Implemented in
- List of results in search shows Breed Name, Group, Origin.
- Assuming implementation based on available data. Display customization might be needed based on the actual model and UI design.
- Details view contains Breed Name, Category (assuming 'group' or 'designation'), Origin, and Temperament.
- Implemented in
DogBreedDetailView
.
- Implemented in
- Unit tests coverage.
- Provided examples for testing view models:
DogBreedListViewModelTests
,DogBreedDetailViewModelTests
, andDogBreedSearchViewModelTests
.
- Provided examples for testing view models:
- [Partialy] Offline functionality.
- Covered with a cache strategy and UserDefault. Consider implementing caching with Core Data or UserDefaults. **ps found a bug on image-cache 🐞
- Error Handling.
- Basic error handling implemented in view models with loading and error message states.
- Create a complete project in a version-controlled repository.
- Ensure the project is committed to a Git repository.
- Perform several commits to show progress.
- Commit history should reflect the development progress and implementation details.
- Share the repository link.
- Make the repository public and prepare to share the link.
- Review and refine the UI/UX design. Ensure the app's interface is intuitive and visually appealing.
- Conduct thorough testing on different devices and OS versions. Ensure compatibility and smooth operation across a range of conditions.
- Optimize performance. Ensure that the app runs smoothly, especially when handling large lists and performing searches.
- Prepare documentation. Include a README with setup instructions, features, and any other relevant information.
linkedin.com/in/fredericobezerra [email protected] freddneos