---
title: "performAndWait(_:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nspersistentstorecoordinator/performandwait(_:)-d3kq"
---

# performAndWait(_:)

Executes the provided closure on the coordinator’s queue and waits for it to finish.

## Declaration

```swift
func performAndWait(_ block: @Sendable () -> Void)
```

## Parameters

- `block`: The closure to execute.

## See Also

### Performing tasks

- [perform(_:)](coredata/nspersistentstorecoordinator/perform(_:)-74udx.md)
- [performAndWait(_:)](coredata/nspersistentstorecoordinator/performandwait(_:)-15ude.md)
- [perform(_:)](coredata/nspersistentstorecoordinator/perform(_:)-7jqb.md)
- [execute(_:with:)](coredata/nspersistentstorecoordinator/execute(_:with:).md)
