Advent Calendar

Let’s create an iPhone app that displays an advent calendar Lock Screen widget.

Create a new Xcode project

You’ll need Xcode 14.0 or later for this project.

Choose “File > New Project”, or click on the “Create a new Xcode Project” button.

Welcome to Xcode

Create App

Project settings

Add a widget target

File > Add Target

Use the “File > Add Target” menu item to add a “Widget target”.

Add Widget Target

Widget Target Options You don’t need a Live Activity. You might want a Configuration intent.

Activate Widget Scheme

Change the preview widget family to .accessoryRectangular

Preview family

Draw the widget

Lock Screen widgets render in xxx mode. This limits you to using alpha and transparency.

Draw Christmas

Set the Metadata

Set Widget Metadat

Simulate

⌘-R to build and run

Command-R to start running the app on the simulator.

Running app

Lock the screen

⌘-L or Device > Lock Screen

Lock screen

Long press to customize

Customize step 1

Choose Lock Screen

Customize step 2

Tap Add Widgets

Customize step 3

Choose Advent Calendar

Add Widgets

Choose the Shape

Choose widget size

Final result

Final

Next steps

Improve graphics

Timeline only needs to update once a year, on Christmas