---
title: "enqueueIORequest(with:frameList:frameListCount:firstFrameNumber:completionHandler:)"
framework: iousbhost
role: symbol
role_heading: Instance Method
path: "iousbhost/iousbhostpipe/enqueueiorequest(with:framelist:framelistcount:firstframenumber:completionhandler:)"
---

# enqueueIORequest(with:frameList:frameListCount:firstFrameNumber:completionHandler:)

Enqueues a request on an isochronous endpoint.

## Declaration

```swift
func enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer<IOUSBHostIsochronousFrame>, frameListCount: Int, firstFrameNumber: UInt64, completionHandler: (@Sendable (IOReturn, UnsafeMutablePointer<IOUSBHostIsochronousFrame>) -> Void)? = nil) throws
```

```swift
func enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer<IOUSBHostIsochronousFrame>, frameListCount: Int, firstFrameNumber: UInt64) async throws -> (IOReturn, UnsafeMutablePointer<IOUSBHostIsochronousFrame>)
```

## Parameters

- `data`: An doc://com.apple.documentation/documentation/Foundation/NSMutableData object defining the memory to use for the transfer.
- `frameList`: A pointer to the first element in an doc://com.apple.iousbhost/documentation/IOUSBHost/IOUSBHostIsochronousFrame array. The array must contain at least frameListCount elements.
- `frameListCount`: The number of elements in frameList.
- `firstFrameNumber`: The frame number the request should begin on. Query the current frame number with doc://com.apple.iousbhost/documentation/IOUSBHost/IOUSBHostObject/frameNumberWithTime:. If 0, the transfer starts on the next available frame (XHCI only).
- `completionHandler`: An doc://com.apple.iousbhost/documentation/IOUSBHost/IOUSBHostIsochronousCompletionHandler that runs when the request completes, or times out if the call returns successfully. The completionHandler doesn’t run if the method returns with an error.

## 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 enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer<IOUSBHostIsochronousFrame>, frameListCount: Int, firstFrameNumber: UInt64) async throws -> (IOReturn, UnsafeMutablePointer<IOUSBHostIsochronousFrame>) For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. This method issues asynchronous isochronous requests. The caller allocates and initializes an array of IOUSBHostIsochronousFrame structures to describe the transferred frames.

## See Also

### Sending Isochronous I/O

- [IOUSBHostIsochronousCompletionHandler](iousbhost/iousbhostisochronouscompletionhandler.md)
- [IOUSBHostTime](iousbhost/iousbhosttime.md)
- [IOUSBHostIsochronousFrame](iousbhost/iousbhostisochronousframe.md)
- [sendIORequest(with:frameList:frameListCount:firstFrameNumber:)](iousbhost/iousbhostpipe/sendiorequest(with:framelist:framelistcount:firstframenumber:).md)
