Apple’s WidgetKit update lets developers build for the lock screen and watch using the same code Vidak For Congress

At a developer briefing after Apple’s keynote address at the Worldwide Developer Conference this afternoon, the company took a closer look at the different types of widgets developers can now build for the iOS 16 lock screen. Inspired by the complications of the Apple Watch, Apple said these new widgets could help developers take important information from their app and display it where people can see it at a glance. Notably, all of these Lock Screen widgets work on both iOS and watchOS because, starting with watchOS 9, complications are also powered by WidgetKit.

That means developers can use the same code for the first time to generate granular information on both platforms, where the differences between platforms are handled automatically, Apple noted. That is, the widgets are created with the correct system fonts by default and the widgets on the lock screen are tinted for maximum readability.

At launch, developers will be able to choose from three different widget designs: round, rectangular, and inline.

The circular widgets are ideal for displaying a small image, page or a few characters of text. These widgets would be great for, for example, letting the user know at a glance how active they’ve been today or when it’s time to go for a run, similar to Apple’s activity rings. Another widget design, rectangular, offers a larger canvas. This could be better for displaying something like an upcoming weather forecast, Apple explained.

Apple's WidgetKit update lets developers build for the lock screen and watch using the same code Vidak For Congress 1

The inline widget, meanwhile, provides a way to convey information with a small amount of text and SF symbols — Apple’s iconography library that today contains more than 4,000 different symbols. These inline widgets appear above the lock screen clock and next to a system-provided date range, such as “Mon 6” (for “Monday the 6th). In an example published alongside an upcoming WWDC 2022 session, Apple showed how this widget could display the weather above the clock. Here, the date is followed by a sun symbol for the weather, as well as the current city.

All widgets are designed by developers using WidgetKit, the toolkit already used to build home screen widgets for iOS, iPadOS, and macOS. The WidgetKit update rolling out later this year will allow developers to build these new widgets and complications into watchOS. This could greatly expand the capabilities of home screen personalization apps such as Brass, Widgetsmith and others, which could provide a range of matching home screen, lock screen and watch widgets so that users can use all their devices in the same way. To adjust.

Another new feature gives widgets the ability to display real-time information. Developers can create live activities built with Swift UI to bring the most current information to the lock screen. Like widgets, these Live Activities are also built with WidgetKit. The difference between a standard widget and a Live Activity is that developers update the presentation and status of the latter in real time, so that the most current one is shown when the user looks at the widget. In reality, Live Activities are really just real-time widgets, but Apple has given it a different name.

The updates to WidgetKit will roll out later this year with iOS 16.

Learn more about WWDC 2022 on Vidak For Congress

    Leave a Comment