top of page

Building an iOS app with Clean Architecture and SwiftUI

Updated: Apr 26

In the previous post we built the core business layer of our app as a Swift package following Clean Architecture principles, so what does it look like to actually use it to build an iOS app?


In today’s post we will learn how to integrate our business logic package to build a functional iOS app.


In case you haven’t already, head over to our previous article to learn the basics of Clean Architecture and to see how we use it to build a Swift Package containing our app’s business logic.


The Persistence Layer of our iOS App


If you’ll recall from our previous blog post, when developing our use cases, we had to abstract where the Employee data came from. To accomplish this we defined an EmployeeRepository protocol which our use cases depended on for retrieving Employee data.


Join my newsletter for exclusive insights, tips, and 25% off any subscription plan!

This abstraction along with the use cases allowed us to build our core business layer code as a separate Swift Package and solely focus on the business rules, not having to worry about details such as whether data comes from a local file or the network.


However, now that we are building an iOS app, it does matter where this data is coming from. Our use cases still don’t care, but since we are now developing the outer layers, namely the persistence/db layer in this case, this detail does matter.



We are now at the outer layers of clean architecture which are responsible for data persistence, so they must know how data is retrieved and saved. This is where we will create a concrete implementation of the EmployeeRepository protocol.


Want to read more?

Subscribe to curiousalgorithm.com to keep reading this exclusive post.

Site
Join the growing community of iOS engineers who are taking their skills to the next level.

© 2025 Curious Algorithm. All rights reserved.

bottom of page