Better Programming

Advice for programmers.

Follow publication

Build a SwiftUI Animal Crossing Application (Part 1)

Combine, services, models, and EnvironmentObject

Thomas Ricouard
Better Programming
Published in
8 min readMay 7, 2020

Photo by the author.

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…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Thomas Ricouard
Thomas Ricouard

Written by Thomas Ricouard

📱 🚀 🇫🇷 [Entrepreneur, iOS/Mac & Web dev] | Now @Medium, @Glose 📖| Past @google 🔍 | Co-founded few companies before, a movies 🎥 app and smart browser one.

Responses (3)

Write a response