Search and see details from Mercado Livre
An iOS App that you can search products and see details from Mercado Livre.
- Xcode 12
- Tuist Tool
Clone or Download the project and follow these steps:.
In order not to commit .xcodeproj files (bye merge conflicts!) and much more cleaner project settings, I decided to use Tuist.
If you don't have Tuist installed in your Mac, don't worry. It's so easy, just run this command to install:
bash <(curl -Ls https://install.tuist.io)
After that, to generate the .xcworkspace and .xcodeproj, run the following commands:
tuist up # Setting up the environment
tuist generate # generate xcodeproj and workspace
tuist focus MLClone # generate the files and open in Xcode
I decided to create some modules for better build performance, code organization and reuse.
It's my network layer with a funny name! I built using URLSession, with some Request/Response logs.
It's a module to build custom UI components, UIKit extensions and View Code helpers.
The main module of the app.
The reason is that MVVM is one of the most used architectures in companies today, it makes unit testing much easier, because the purpose of MVVM is that the code is broken up into classes with a small number of well defined responsibilities. Following up SOLID principals and having a clean, maintainable and testable code.
I use a tool called Swift Mock Generator for Xcode. This tool is a plugin and command line tool to generate spy, dummy, partial spy classes automatically, without add any third libraries in your project. I highly recommend!
There are several reasons why I prefer to create my views programmatically, but the main reason is that it improves the build time of the app. This is topic that many huge companies are concerned. Another reason is that it is on my roadmap to implement Buck and using Xib / Storyboard can cause some extra issues.
Décio Montanhani – @deciomontanhani – https://deciomontanhani.com.br