---
title: NCWidgetController
framework: notificationcenter
role: symbol
role_heading: Class
path: notificationcenter/ncwidgetcontroller
---

# NCWidgetController

An object used to specify whether a Today widget has content to display.

## Declaration

```swift
class NCWidgetController
```

## Overview

Overview The NCWidgetController class defines an object that both a Today widget and the containing app that delivers the widget can use to specify whether the widget has content to display. Because this class helps a widget and its containing app coordinate the display of the widget’s content, a widget that doesn’t communicate with its containing app is unlikely to use this class. Typically, a widget appears in the Today view when it has content to display. If a currently running widget no longer has content to display, it can get a widget controller and set the flag in the setHasContent(_:forWidgetWithBundleIdentifier:) method to false. If the containing app later determines that there is content this widget should display, the app can get a widget controller and update the flag, even while the widget isn’t running. The NCWidgetController class should not be subclassed.

## Topics

### Getting a Widget Controller

- [widgetController()](notificationcenter/ncwidgetcontroller/widgetcontroller().md)

### Specifying the Presence of Content

- [setHasContent(_:forWidgetWithBundleIdentifier:)](notificationcenter/ncwidgetcontroller/sethascontent(_:forwidgetwithbundleidentifier:).md)

### Type Methods

- [default()](notificationcenter/ncwidgetcontroller/default().md)

### Initializers

- [init()](notificationcenter/ncwidgetcontroller/init().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)

## See Also

### Core Widget

- [NCWidgetProviding](notificationcenter/ncwidgetproviding.md)
