First clue
Etienne Vautherin - 2024/06/03
This article is part of the detective fiction about iOS 18
A Dynamic Island is not an icing on the cake because it changes the recipe.
The Dynamic Island is a recent user interface element that integrates the front-facing camera and Face ID sensors into a pill-shaped cutout at the top of the screen. This cutout is not just a static element; it dynamically changes size and shape to display various types of information and to interact with the user.
Using such an element, a background application can provide useful information and interaction with minimal disruption to the main screen content.
Apple has provided APIs for developers to integrate their apps with the Dynamic Island, allowing third-party apps to use this space for their own alerts and notifications.
Adding a Dynamic Island to an existing app involves to synchronise an existing app state property with a Live Activity ContentState
property. Such synchronisation could be achieved:
-
By sharing a Swift Combine publisher assigned to the view state property. However a Combine publisher is no longer the favorite approach to update a state. The latest iOS API, such as
liveUpdates
fromCLLocationUpdate
, are asynchronous sequences, not publishers. -
By sharing an asynchronous sequence instead of a publisher. However the
share
operator isn’t available forAsyncSequence
: Apple engineers weren’t convinced on June 8, 2022. Two years later, this conviction still remains very weak… -
By observing the SwiftUI view state. This topic sounds more promising but
withObservationTracking
only watches for a single change when we need a continuous stream of updates.
All these solutions lead to this simple conclusion: adding a Live Activity on the top of an app isn’t a piece of cake.
Here is the following idea: we could reverse this cake and make the Live Activity not just an adornment, but the foundation for the future!
I do love the idea of reversing the picture to solve an architectural problem. This is exactly how Antonio Gaudi calculated his vault profiles: he mirrored the resistance to gravity on the vault with upside-down hanging chains! Structural Design in the Work of Gaudi
Second clue: The SwiftUI App Scene
doesn’t have any backstage!