<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeviceActivity",
  "identifier" : "/documentation/DeviceActivity/DeviceActivityCenter/schedule(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Device Activity"
    ],
    "preciseIdentifier" : "s:14DeviceActivity0aB6CenterV8schedule3forAA0aB8ScheduleVSgAA0aB4NameV_tF"
  },
  "title" : "schedule(for:)"
}
-->

# schedule(for:)

Fetches the schedule of a device activity.

```
func schedule(for activity: DeviceActivityName) -> DeviceActivitySchedule?
```

## Parameters

`activity`

The name of the activity.

## Return Value

The schedule of the activity or `nil` if no such activity is currently monitored.

## Discussion

The returned object is a static representation of the schedule at the time the function was called. In other
words, a `Schedule` fetched for a particular activity doesn’t dynamically update in response to future
changes made to that activity.

---

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)