<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeviceActivity",
  "identifier" : "/documentation/DeviceActivity/DeviceActivitySchedule/warningTime",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Device Activity"
    ],
    "preciseIdentifier" : "s:14DeviceActivity0aB8ScheduleV11warningTime10Foundation14DateComponentsVSgvp"
  },
  "title" : "warningTime"
}
-->

# warningTime

Optional components that generate a warning prior to regularly scheduled events.

```
var warningTime: DateComponents? { get }
```

## Discussion

You can create a warning time to notify your app extension ahead of time
before the scheduled activity begins and ends. For instance,
when your app schedules activity-monitoring from 10 a.m. to 11 a.m. for an event with a 30-minute threshold,
setting the schedule’s warning time to 5 minutes results in the extension receiving
[`intervalWillStartWarning(for:)`](/documentation/DeviceActivity/DeviceActivityMonitor/intervalWillStartWarning(for:)),
[`intervalWillEndWarning(for:)`](/documentation/DeviceActivity/DeviceActivityMonitor/intervalWillEndWarning(for:)), and
[`eventWillReachThresholdWarning(_:activity:)`](/documentation/DeviceActivity/DeviceActivityMonitor/eventWillReachThresholdWarning(_:activity:)) callbacks at 9:55 a.m.,
10:55 a.m, and when 25 minutes of the event’s activity occurs, respectively. If the components specify a longer time
interval than the schedule’s interval, the system clamps the warning callbacks for each event’s threshold to the start
time of the interval.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)