The Pods
folder is added to .gitignore
. Please run pod install
to install all the required dependencies for this project
Blog Post on this project coming soon on https://jayeshkawli.ghost.io/. Please stay tuned!
Screen.Recording.2023-01-23.at.10.11.34.AM.mov
The aim of this project is to develop an iOS app to display and search random GIFs using given Giphy endpoints.
This app has couple of screens with following features,
-
Home screen - This screen is shown on the first app startup. It will display the random GIF and update it every 10 seconds
-
GIF details screen - This screen will display GIF in more detail which includes GIF, its title, URL and PG rating for the current image
-
User can also search GIFs by keyword by typing desired keyword into search field. The search will trigger when the user has entered at least 3 characters
The app uses MVVM architecture. I wanted to separate out all the business and data transformation logic away from the view layer. The view model is responsible for getting network models (Codable models) and converting them into local view models to be consumed by the view.
The view model interacts with the network layer through protocols and get the required data with network calls via interfaces.
I ruled out MVC due to it polluting the view layer and make it difficult to just test the business logic due to intermixing with view. I also thought about VIPER architecture, but it seemed an overkill for feature this small given the boilerplate code it tends to add. Finally I decided to use MVVM as a middle ground between these two possible alternatives
App can be run simply by opening "PicnicRecruitmentTask.xcworkspace" file and pressing CMD + R to run it
I have written unit tests to test the view model layer and other parts of the app which involves business logic or the data transformation. Tests are written with the mindset to only test the logic layer leaving view layer aside.
I didn't add any UI tests in the interest of time, but can be added as a follow-up. My idea around UI tests is we can write UI tests (Including snapshot tests) for individual components and end-to-end tests to verify the flow making sure screens load as expected.
This app is currently supported only on iPhone in the portrait mode
I am using third party images from following sources in the app,
https://hotpot.ai/free-icons?s=sfSymbols https://en.wikipedia.org/wiki/Motion_Picture_Association_film_rating_system
I am using FLAnimatedImage library to show the animated GIFs on SwiftUI views. SwiftUI does not have native support to show animated image so I had to resort to 3rd party support.
App needs minimum version of iOS 14 for deployment
App was successully compiled and run on Xcode version 14