Member-only story
Build a SwiftUI Animal Crossing Application (Part 1)
Combine, services, models, and EnvironmentObject

In this new series of articles, I’ll guide you through the making of my latest open-source project.
It is once again a fully open-source, fully SwiftUI application.
And this time, it’s even available on the App Store! This goes to prove my point that you can have SwiftUI code in production.
But unlike MovieSwiftUI, it doesn’t use the Redux architecture but just the very core of the SwiftUI built-in data flow that I’ve already covered in the past. If you need an introduction or refresher, you should read this article.
I’m using a combination of view, view models, and some environment objects. By following this series of articles, you’ll be able to fully grasp a very simple yet effective SwiftUI application architecture.
Let’s begin with the services and models layer because for the application to be fun, we’ll first need to gather, compute, and fetch some data to put in our data sources. We’ll use Combine, a new (WWDC 19) framework from Apple that allows users to beautifully process data in a reactive way.
For people not familiar with Animal Crossing, the game is all about playing a bit daily. The game uses the real-time clock to progress. And it’s all about collecting items, furniture to decorate your house and island, and also catching critters, fish, bugs, and fossils. That depends on the time of day and the date.
This is all to say that Animal Crossing is the perfect game to make an app for because it has a ton of data (more than 5,000 items to catalog, display, and play with) in the form of information, images, and such. It’s a good candidate for which…