Created by Preema DSouza
This project is implemented using Xcode 11.7 and Swift 5 and follow MVVM design pattern. This project is about fetching and presenting photos based on user input search text. It uses the pod SdWebImage to assist download of images. The project also provides a history of past search terms by using Core Data.
Please open FlickrSearch.xcworkspace as opposed to FlickrSearch.xcodeproj due to existence of pod.
There are two view controllers, PhotosViewController and HistoryViewController
A ViewController that contains a SearchController to perform the search and a CollectionView to display the results
A ViewController that contains the list of past search terms in a TableView
A singleton instance that is responsible for getting the search result from the API
There are two models: Photos and Photo
Decodable struct that represents the result returned by the API
Decodable struct that represents a single Photo entry
This is a UICollectionViewCell which is responsible for displaying a product with the help of PhotoViewModel
View Model for PhotosViewController. It is also responsible for persisting search term to the corresponding Entity
View Model for PhotoCollectionViewCell
View Model for HistoryViewController
Core Data Stack for the project. Has the save and fetch methods
History+CoreDataClass and History+CoreDataProperties
Helper to save search term
Data entity handler. Helps DataManager fetch existing entires and eliminate duplicates
Tests for PhotosViewModel validations
Tests for PhotoViewModel validations
Tests for HistoryViewModel validations