So mainly I discovered this from a WWDC video for Display screen Time API:
"The response can both be to shut the shielded software or defer motion and redraw the protect configuration.
The flexibility to defer motion within the protect could be very highly effective as a result of it provides the protect the possibility to replace its look whereas it waits for a sign on the best way to proceed.
For example, it may be used to point that the protect is ready for a guardian’s motion when the kid faucets Ask for Entry right here."
My aim is to do the identical as the instance however information the consumer from the Protect Configuration to my very own app after which let the consumer hit a button to let the consumer entry the particular app. Nonetheless I simply need assistance with the button telling the awaiting protect that the app may be accessed. The under code can be from the WWDC video:
import ManagedSettings
class MyShieldActionExtension: ShieldActionHandler {
override func deal with(
motion: ShieldAction,
for software: Utility,
completionHandler: @escaping (ShieldActionResponse) -> Void
) {
swap motion {
case .primaryButtonPressed:
completionHandler(.defer)
case .secondaryButtonPressed:
completionHandler(.shut)
@unknown default:
fatalError()
}
}
}