ApplicationManager
@MainActor
public protocol ApplicationManager
The interface of the ApplicationManager
which can be used to inject different implementations.
Normally code should not be directly dependent upon the UIApplication
because that might break UnitTests
when running the tests on a device / simulator which differs from the test’s expectations.
Therefore, code should get the UIApplication
instance being injected and for tests it should be mocked.
It’s expected that the implementation informs the ObservableObject
of any value changes.
-
A boolean which refers
isIdleTimerDisabled
on UIApplicationDeclaration
Swift
@MainActor var isScreenLockEnabled: Bool { get }
-
Disables screen dimming automatically
Declaration
Swift
@MainActor func disableScreenLock()
-
Enables screen dimming automatically
Declaration
Swift
@MainActor func enableScreenLock()