Build Your First iOS Widget — Part 1

Creating an emoji app and widget with SwiftUI

Ale Patrón
The Startup

--

Note: This is part 1 of a 3-part tutorial. Find part 2 here, and part 3 here.

Small iOS 🦄 emoji widget.

During WWDC 2020, Apple announced the introduction of app widgets for iOS (as well as iPadOS and MacOS). With the new WidgetKit framework, you can build widgets that can be added to your home screen to let you see important information at a glance. While you may be familiar with widgets in other operating systems, they are a completely new addition to iOS, and developers are already starting to build very exciting widgets using WidgetKit.

So let’s go ahead and build a new widget. We’re going to create a simple app I like to call Emojibook; this app will display a list of emoji along with their names, as well as more details about the emoji whenever one of them is tapped. We will create a widget that you can add to your homescreen to display an emoji, which will be updated randomly every hour or so.

Note: You’ll need Xcode 12 Beta 2 or higher to follow this tutorial.

This is what our app will look like:

Emojibook app and widget.

Simple List-based App

--

--