Updates the descendants of the given context.
- iOS 12.2+
The context whose descendant contexts the method should update.
A completion block the method calls when it finishes. Pass an optional error to indicate failure, or
nilto indicate success.
When a teacher browses your app’s hierarchy of assignable content in Schoolwork, the Schoolwork app triggers the
update method for each context that it shows. For example, when the teacher taps on a book reader app to reveal a list of available books, Schoolwork triggers an update call for each book. In response, the method updates or creates the chapters associated with the given book.
You can use this method call to update only the context’s direct descendants—like the chapters for a given book—or the entire context hierarchy underneath the given context—like all of a book’s chapters, sections, and quizzes. Regardless, Schoolwork triggers an update method call for every context at every level of hierarchy as they appear in Schoolwork’s interface.
Finish your updates and call the completion block as quickly as possible to minimize update delay in the Schoolwork interface. But only call the completion block after you’re done making changes. For example, if you need to call the data store’s
save method, only call the update method’s completion block from within the save method’s completion handler: