---
title: DeviceActivityMonitor
framework: Device Activity
role: symbol
role_heading: Class
platforms: [iOS 15.0+, iPadOS 15.0+, Mac Catalyst 15.0+]
path: deviceactivity/deviceactivitymonitor
---

# DeviceActivityMonitor

The object that monitors scheduled device activity.

## Declaration

```swift
@objc class DeviceActivityMonitor
```

## Overview

Overview DeviceActivityMonitor provides the entry point into a device activity monitor extension. You should subclass DeviceActivityMonitor and designate your subclass as the principal class of your app extension. The following code implements DeviceActivityMonitor in an app: class MyMonitorExtension: DeviceActivityMonitor {   let store = ManagedSettingsStore()

// You can use the `store` property to shield apps when an interval starts, ends, or meets a threshold.   override func intervalDidStart(for activity: DeviceActivityName) {       super.intervalDidStart(for: activity)

// Shield selected applications.       let model = MyModel()       let applications = model.selectionToShield.applications       store.shield.applications = applications.isEmpty ? nil : applications    } note: Shielding an app dims the app’s icon on the homescreen and applies an hourglass symbol. When the app launches, the system covers it with a view that your app can configure.

## Topics

### Configuring a Monitor

- [init()](deviceactivity/deviceactivitymonitor/init().md)

### Monitoring Scheduled Intervals

- [intervalDidEnd(for:)](deviceactivity/deviceactivitymonitor/intervaldidend(for:).md)
- [intervalDidStart(for:)](deviceactivity/deviceactivitymonitor/intervaldidstart(for:).md)
- [intervalWillEndWarning(for:)](deviceactivity/deviceactivitymonitor/intervalwillendwarning(for:).md)
- [intervalWillStartWarning(for:)](deviceactivity/deviceactivitymonitor/intervalwillstartwarning(for:).md)

### Monitoring Event Thresholds

- [eventDidReachThreshold(_:activity:)](deviceactivity/deviceactivitymonitor/eventdidreachthreshold(_:activity:).md)
- [eventWillReachThresholdWarning(_:activity:)](deviceactivity/deviceactivitymonitor/eventwillreachthresholdwarning(_:activity:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
