Ios Interruption Handling
Observe scenePhase changes and save state on background, pause on inactive, and resume cleanly on active — ensuring no user progress is lost across system interruptions.
$ prime install @community/rule-ios-interruption-handling Projection
Always in _index.xml · the agent never has to ask for this.
IosInterruptionHandling [rule] v1.0.0
Observe scenePhase changes and save state on background, pause on inactive, and resume cleanly on active — ensuring no user progress is lost across system interruptions.
Loaded when retrieval picks the atom as adjacent / supporting.
IosInterruptionHandling [rule] v1.0.0
Observe scenePhase changes and save state on background, pause on inactive, and resume cleanly on active — ensuring no user progress is lost across system interruptions.
Applies To
any iOS app with in-progress work that can be interrupted by system events (calls, Siri, notifications, backgrounding)
Loaded when retrieval picks the atom as a focal / direct hit.
IosInterruptionHandling [rule] v1.0.0
Observe scenePhase changes and save state on background, pause on inactive, and resume cleanly on active — ensuring no user progress is lost across system interruptions.
Applies To
any iOS app with in-progress work that can be interrupted by system events (calls, Siri, notifications, backgrounding)
Examples
- scenePhase .background: persist any unsaved form input or recording state to UserDefaults or disk.
- scenePhase .inactive: pause media playback, timers, or active animations.
- scenePhase .active: resume timers; restore UI to the last known state.
- Verify: receive a phone call during active use; app should pause cleanly and restore state when foregrounded.
Rationale
iOS apps are regularly interrupted by phone calls, Siri invocations, and notifications. Losing user progress or active state on interrupt is unexpected and erodes trust. ScenePhase provides the correct lifecycle hooks for saving and restoring state.
Applies To
any iOS app with in-progress work that can be interrupted by system events (calls, Siri, notifications, backgrounding)
Source
prime-system/examples/frontend-design/primes/compiled/@community/rule-ios-interruption-handling/atom.yaml