How to modularize existing iOS projects using Swift Package

Click for: original source

Modular programming is a software design technique that breaks your project into a smaller maintainable module which promotes separation of concern and reusability. By @sarunw.com.

Modularizing your app may sound technical and complicated, but in reality, it is just as easy as grouping your files in a folder and you don’t need to modularize everything at the very beginning. You can incrementally adopt this part by part at your own pace.

The content of article covers five small steps we need to do to modularize an app:

  • Create a new Swift Package within your project
  • Move files from the main project to the newly created Swift Package
  • Configure Swift Package supported platform
  • Add Swift Package to the main project
  • Change access levels of classes and methods, e.g., private, public

Breaking part of your app into a module is straightforward with Swift Package. It only contains 5 steps, as we learned in this article. You will get screenshots and detailed instruction for each step above. Nice one!

[Read More]

Tags programming ios swiftlang performance app-development