Class

CLSContext

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

Declaration

@interface CLSContext : CLSObject

Overview

Configure contexts with enough information to make it easy for teachers to understand what app content the context represents. For example, make sure each context has a title that is clear, concise, and localized for any region that your app supports.

A context can also contain a grouping of other contexts, like a book that contains chapter contexts or a chapter that contains section contexts. You can assemble contexts into a hierarchy, up to eight levels deep, that acts as a sort of table of contents for teachers who want to assign your app content. See Advertising Your App’s Assignable Content for more details.

Topics

Creating Contexts

- initWithType:identifier:title:

Initializes a new context.

CLSObject

The abstract base class for objects managed by ClassKit.

Configuring a Context

title

The name of the context as it appears to users.

identifier

A string that uniquely identifies a context among its siblings.

type

The kind of content a context represents.

CLSContextType

The kinds of assignable content a context can contain.

Managing Context Presentation

displayOrder

The position of a context relative to its siblings.

topic

The area of study to which a context relates.

CLSContextTopic

The areas of study to which contexts may relate.

Activating and Deactivating a Context

Informing ClassKit That a Task Is About to Begin

Activate and deactivate contexts according to user interaction.

- becomeActive

Tells a context to become the active context.

- resignActive

Tells a context to stop being the active context.

active

A Boolean indicating whether the context is active.

Creating Activities

currentActivity

The activity available for recording progress.

- createNewActivity

Creates and returns a new activity instance for the context.

Managing Context Hierarchy

parent

The direct ancestor of this context.

- removeFromParent

Removes the context from its parent.

- addChildContext:

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

- descendantMatchingIdentifierPath:completion:

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

Configuring Deep Links

Linking Directly to Assignments

Make it easy for teachers to guide students to specific content.

universalLinkURL

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

isClassKitDeepLink

Indicates whether a user activity represents a ClassKit context.

contextIdentifierPath

The identifier path associated with a user activity generated by an app that adopts ClassKit.

Relationships

Inherits From

See Also

Contexts

Advertising Your App’s Assignable Content

Assemble a hierarchy of contexts and declare your app’s assignable content.

CLSContextProvider

An interface used to tell your ClassKit context provider app extension to update contexts.