---
title: activeContext
framework: classkit
role: symbol
role_heading: Instance Property
path: classkit/clsdatastore/activecontext
---

# activeContext

The currently active context.

## Declaration

```swift
var activeContext: CLSContext? { get }
```

## Discussion

Discussion This value is nil if there is no currently active context. To activate a context when a student begins working on the content that the context represents, call its becomeActive() method. To deactivate a context when the student finishes, call its resignActive() function. Only one context may be active at a time. If you activate a context, the system automatically causes any previously active context to resign.

## See Also

### Accessing specific contexts and activities

- [mainAppContext](classkit/clsdatastore/mainappcontext.md)
- [runningActivity](classkit/clsdatastore/runningactivity.md)
- [fetchActivity(for:completion:)](classkit/clsdatastore/fetchactivity(for:completion:).md)
- [completeAllAssignedActivities(matching:)](classkit/clsdatastore/completeallassignedactivities(matching:).md)
