Screen Time | How to enable/disable screen time for a game app by setting start and end times?

try center.startMonitoring(.daily, during: schedule)

let schedule = DeviceActivitySchedule( intervalStart: DateComponents(calendar: Calendar.current ,hour: 20, minute: 0), intervalEnd: DateComponents(calendar: Calendar.current ,hour: 22, minute: 59), repeats: true, warningTime: nil )

extension DeviceActivityName { static let daily = Self("daily") }

What exactly are you trying to do?

Screen Time | How to enable/disable screen time for a game app by setting start and end times?
 
 
Q