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

# navigationChildContexts

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

```
var navigationChildContexts: [CLSContext] { get }
```

## Discussion

A given context exists at exactly one place in your app’s context hierarchy. However, you might want to provide multiple ways to navigate to a context. For example, you might define a set of quiz contexts as children of your app’s main context:

- Algebra quiz
- Fractions quiz
- Spelling quiz
- Grammar quiz

In addition to providing a flat list, you might want to group these tasks according one or more criteria. For example, you can group by subject:

- Math quizzes — Contains algebra and fractions quizzes.
- Language quizzes — Contains spelling and grammar quizzes.

You can also group by difficulty level:

- Beginner Quizzes — Contains fractions and spelling quizzes.
- Advanced quizzes — Contains algebra and grammar quizzes.

If you create contexts for the math and language, and beginner and advanced groups, and then add child quizzes to each by defining unique [`identifierPath`](/documentation/ClassKit/CLSContext/identifierPath) values, you’ll create new contexts inside each group. This results in three distinct contexts — the original from the flat list, plus one for each group — to represent each individual quiz.

After creating the grouping contexts, you need to define only one context for each quiz. To do this, update each group’s [`navigationChildContexts`](/documentation/ClassKit/CLSContext/navigationChildContexts) collection to indicate all the children that you can navigate to from that group. Use [`addNavigationChildContext(_:)`](/documentation/ClassKit/CLSContext/addNavigationChildContext(_:)) to add contexts and [`removeNavigationChildContext(_:)`](/documentation/ClassKit/CLSContext/removeNavigationChildContext(_:)) to remove them.

```swift
// Group by subject.
mathQuizzes.addNavigationChildContext(algebraQuiz)
mathQuizzes.addNavigationChildContext(fractionsQuiz)
languageQuizzes.addNavigationChildContext(spellingQuiz)
languageQuizzes.addNavigationChildContext(grammarQuiz)

// Group the same set of original quizzes by difficulty.
beginnerQuizzes.addNavigationChildContext(fractionsQuiz)
beginnerQuizzes.addNavigationChildContext(spellingQuiz)
advancedQuizzes.addNavigationChildContext(algebraQuiz)
advancedQuizzes.addNavigationChildContext(grammarQuiz)
```

---

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)