---
title: "continueActivity(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocument/continueactivity(_:)"
---

# continueActivity(_:)

Continues to perform the task for a user activity object using a different block.

## Declaration

```swift
func continueActivity(_ block: () -> Void)
```

## Parameters

- `block`: The block to be invoked.

## Discussion

Discussion When AppKit calls performActivity(withSynchronousWaiting:using:) recursively, it may execute this method with the specified block to avoid a deadlock. If a block that was passed to performActivity(withSynchronousWaiting:using:) is being invoked, this method invokes the passed-in block, having recorded state that makes inner invocations of performActivity(withSynchronousWaiting:using:) not wait. If this method is invoked outside of an invocation of a block passed to performActivity(withSynchronousWaiting:using:), this method simply invokes the passed-in block. This method is useful when code executed in a block passed to performActivity(withSynchronousWaiting:using:) may also invoke that method. For example, save(withDelegate:didSave:contextInfo:), which uses performActivity(withSynchronousWaiting:using:), uses this around its invocation of runModalSavePanel(for:delegate:didSave:contextInfo:) or save(to:ofType:for:delegate:didSave:contextInfo:) because both of those methods also use performActivity(withSynchronousWaiting:using:). Without the use of this method the inner invocation of performActivity(withSynchronousWaiting:using:) would wait forever.

## See Also

### Performing Tasks Serially

- [performSynchronousFileAccess(_:)](appkit/nsdocument/performsynchronousfileaccess(_:).md)
- [performAsynchronousFileAccess(_:)](appkit/nsdocument/performasynchronousfileaccess(_:).md)
- [performActivity(withSynchronousWaiting:using:)](appkit/nsdocument/performactivity(withsynchronouswaiting:using:).md)
- [continueAsynchronousWorkOnMainThread(_:)](appkit/nsdocument/continueasynchronousworkonmainthread(_:).md)
