Aleksa Simic
June 27, 2024
•
10 min read
For some time, I am working on researching how large scale iOS apps work, and at the same time, implement all of the findings on a one pretty large scale iOS project I am working on at the moment.
Every big iOS application, heavily relies on modularization and creating feature modules for better separation of concerns, reducing build times, fast previews, and improving development speed and experience.
Bunch of these large organizations also take it a step further by creating a separate runnable targets for each feature module in their iOS apps. This approach allows feature teams to not have to build to whole app in order to contribute to the codebase and add new things or fix bugs in the feature module they are responsible for.
During my modularization research, I noticed that a lot of people want to get started with modularization in their iOS apps but don't know where to start when they want to create a runnable target for a feature module. I was in a similar situation myself once. That's the reason why I decided to make a step by step guide on how to do it the right way.
If you are looking to learn about modularization of iOS apps, I highly recommend you to start with this video: Bruno Rocha: Preparing for Growth: Architecting Giant Apps for Scalability and Build Speed
These are the list of steps needed to create a feature module target:
1. Creating a feature module as a SPM package
2. Choosing a feature module package name
3. Overview of the project after feature module creation
4. Add a feature module target
5. Choose App in the target template picker
6. Overview of the project after feature module target creation
7. Link the previously created feature module SPM package to a feature target
8. Run the app and enjoy your modularized iOS application!
Modularizing your iOS apps doesn't have to be that difficult. While I strongly recommend you to go through this step by step process of feature module package and feature module target creation, I have also created a GitHub repository where you can find the the example project. You can find it here.
iOS engineers from all over the world found these e-books and project templates as the ultimate source of knowledge needed to build and scale their mobile apps