---
title: "save(completion:)"
framework: classkit
role: symbol
role_heading: Instance Method
path: "classkit/clsdatastore/save(completion:)"
---

# save(completion:)

Saves any changes you’ve made in the data store.

## Declaration

```swift
func save(completion: (@Sendable ((any Error)?) -> Void)? = nil)
```

```swift
func save() async throws
```

## Parameters

- `completion`: A closure the method calls on completion of the save operation with an optional error value that indicates the reason for failure, if any.

## Mentioned in

Recording student progress

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func save() async throws For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. important: ClassKit calls your completion handler on an arbitrary thread. If you need to do work on a particular thread from inside the handler, dispatch that work to the appropriate queue.
