Member-only story
Using SwiftUI View Modifiers to Display Empty State
Create meaningful empty states
Empty state is an important aspect of UX — it’s what users see when they first open your app, and as the saying goes, there is no second chance to leave a first impression — so it better be good. Showing users a meaningful empty state will make them feel welcome and is a great opportunity for you to educate them about how to get started with the app.
So far, Make It So doesn’t display a meaningful empty state, and in this article, we will look at a couple of options to implement this.
What we’re going to build
To get started, let’s take a look at Apple’s Reminder app (since this is the app that we’re trying to replicate):
A simple way to implement empty state is to use Xcode’s Make Conditional refactoring ( CMD + Click on a view, then choose Make Conditional). This will wrap the view in an if ... else
statement and wrap the entire structure in a VStack
: