---
title: "setDelegateQueue(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsurlconnection/setdelegatequeue(_:)"
---

# setDelegateQueue(_:)

Determines the operation queue that is used to call methods on the connection’s delegate.

## Declaration

```swift
func setDelegateQueue(_ queue: OperationQueue?)
```

## Parameters

- `queue`: The operation queue to use when calling delegate methods.

## Discussion

Discussion By default, a connection is scheduled on the current thread in the default mode when it is created. If you create a connection with the init(request:delegate:startImmediately:) method and provide false for the startImmediately parameter, you can instead schedule the connection on an operation queue before starting it with the start() method. You cannot reschedule a connection after it has started. It is an error to schedule delegate method calls with both this method and the schedule(in:forMode:) method.

## See Also

### Scheduling Delegate Method Calls

- [schedule(in:forMode:)](foundation/nsurlconnection/schedule(in:formode:).md)
- [unschedule(from:forMode:)](foundation/nsurlconnection/unschedule(from:formode:).md)
