<!--
{
  "availability" : [
    "iOS: 11.3.0 -",
    "iPadOS: 11.3.0 -",
    "macCatalyst: 11.3.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ClassKit",
  "identifier" : "/documentation/ClassKit/CLSContext",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ClassKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CLSContext"
  },
  "title" : "CLSContext"
}
-->

# CLSContext

An area of your app that represents an assignable task, like a quiz or a chapter.

```
class CLSContext
```

## Overview

Make it easy for teachers to understand the app content a context represents by configuring it with information like a clear, concise title localized for the regions that your app supports.

A context can contain groups of other contexts, like a book that contains chapters or a chapter that contains sections. You can assemble contexts into a hierarchy of up to eight levels that acts as a table of contents for teachers who want to assign your app content. See <doc://com.apple.classkit/documentation/ClassKit/advertising-your-app-s-assignable-content> for more details.

## Topics

### Creating contexts

[`-  initWithType:identifier:title:`](/documentation/ClassKit/CLSContext/init(type:identifier:title:))

Initializes a new context.

[`CLSObject`](/documentation/ClassKit/CLSObject)

The abstract base class for objects managed by ClassKit.

### Identifying the context

[`identifier`](/documentation/ClassKit/CLSContext/identifier)

A string that uniquely identifies a context among its siblings.

[`title`](/documentation/ClassKit/CLSContext/title)

The name of the context as it appears to users.

[`summary`](/documentation/ClassKit/CLSContext/summary)

An optional, user-visible description of the context.

[`thumbnail`](/documentation/ClassKit/CLSContext/thumbnail)

An optional thumbnail image associated with the context.

### Managing the context type

[`type`](/documentation/ClassKit/CLSContext/type)

The kind of content a context represents.

[`-  setType:`](/documentation/ClassKit/CLSContext/setType(_:))

Updates the kind of content that a context represents.

[`CLSContextType`](/documentation/ClassKit/CLSContextType)

The kinds of assignable content a context can contain.

[`customTypeName`](/documentation/ClassKit/CLSContext/customTypeName)

An optional name that the system presents to the user if you choose the custom context type.

### Characterizing the context

[`suggestedAge`](/documentation/ClassKit/CLSContext/suggestedAge)

The range of ages, measured in years, for which you deem a context’s content suitable.

[`suggestedCompletionTime`](/documentation/ClassKit/CLSContext/suggestedCompletionTime)

A suggested time range to complete a task, measured in minutes.

[`assignable`](/documentation/ClassKit/CLSContext/isAssignable)

A Boolean that indicates whether teachers can assign the context as a task.

### Managing context presentation

[`displayOrder`](/documentation/ClassKit/CLSContext/displayOrder)

The position of a context relative to its siblings.

[`topic`](/documentation/ClassKit/CLSContext/topic)

The area of study to which a context relates.

[`CLSContextTopic`](/documentation/ClassKit/CLSContextTopic)

The areas of study to which contexts may relate.

### Indicating progress reporting capabilities

[`progressReportingCapabilities`](/documentation/ClassKit/CLSContext/progressReportingCapabilities)

The kinds of progress reporting that the context can perform.

[`-  addProgressReportingCapabilities:`](/documentation/ClassKit/CLSContext/addProgressReportingCapabilities(_:))

Adds a progress reporting capability to the set of capabilities for the context.

[`-  resetProgressReportingCapabilities`](/documentation/ClassKit/CLSContext/resetProgressReportingCapabilities())

Resets the set of capabilities for the context.

[`CLSProgressReportingCapability`](/documentation/ClassKit/CLSProgressReportingCapability)

A progress reporting capability supported by a context.

### Activating and deactivating a context

  <doc://com.apple.classkit/documentation/ClassKit/informing-classkit-that-a-task-is-about-to-begin>

[`-  becomeActive`](/documentation/ClassKit/CLSContext/becomeActive())

Tells a context to become the active context.

[`-  resignActive`](/documentation/ClassKit/CLSContext/resignActive())

Tells a context to stop being the active context.

[`active`](/documentation/ClassKit/CLSContext/isActive)

A Boolean indicating whether the context is active.

### Creating activities

[`currentActivity`](/documentation/ClassKit/CLSContext/currentActivity)

The activity available for recording progress.

[`-  createNewActivity`](/documentation/ClassKit/CLSContext/createNewActivity())

Creates and returns a new activity instance for the context.

### Managing context hierarchy

[`identifierPath`](/documentation/ClassKit/CLSContext/identifierPath)

The identifier path that locates the context within the data store’s context hierarchy.

[`parent`](/documentation/ClassKit/CLSContext/parent)

The direct ancestor of this context.

[`-  removeFromParent`](/documentation/ClassKit/CLSContext/removeFromParent())

Removes the context from its parent.

[`-  addChildContext:`](/documentation/ClassKit/CLSContext/addChildContext(_:))

Adds the specifed context as a child of the context receiving the method call.

[`-  descendantMatchingIdentifierPath:completion:`](/documentation/ClassKit/CLSContext/descendant(matchingIdentifierPath:completion:))

Finds the context with the given identifier path relative to this context.

### Creating a context presentation hierarchy

[`navigationChildContexts`](/documentation/ClassKit/CLSContext/navigationChildContexts)

The child contexts that a user can navigate to from this context in the Schoolwork app.

[`-  addNavigationChildContext:`](/documentation/ClassKit/CLSContext/addNavigationChildContext(_:))

Adds a child context that users can navigate to from this context.

[`-  removeNavigationChildContext:`](/documentation/ClassKit/CLSContext/removeNavigationChildContext(_:))

Removes the specified context as a presentable child of this context.

### Configuring deep links

  <doc://com.apple.classkit/documentation/ClassKit/linking-directly-to-assignments>

[`universalLinkURL`](/documentation/ClassKit/CLSContext/universalLinkURL)

A URL that leads to the content in your app associated with the current context.

  <doc://com.apple.documentation/documentation/Foundation/NSUserActivity/isClassKitDeepLink>

  <doc://com.apple.documentation/documentation/Foundation/NSUserActivity/contextIdentifierPath>

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`CLSObject`](/documentation/ClassKit/CLSObject)

---

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)