---
title: handler
framework: carplay
role: symbol
role_heading: Instance Property
path: carplay/cplistimagerowitem/handler
---

# handler

An optional closure that CarPlay invokes when the user selects the list item.

## Declaration

```swift
var handler: ((any CPSelectableListItem, @escaping () -> Void) -> Void)? { get set }
```

## Discussion

Discussion In Swift, this property is a closure that has two parameters: An object that conforms to CPSelectableListItem, which is the list item that the user selects. The completion closure you call to notify CarPlay when you finish processing the selection. In Objective-C, the block’s parameters are: CarPlay executes your handler on the main queue. You must call the completion closure, or completionBlock in Objective-C, after you finish processing the selection. If you need to perform asynchronous tasks, dispatch them to a background queue and call the completion closure or completionBlock when they complete. CarPlay displays an asynchronous progress indicator until you call the completion closure.

## See Also

### Managing Selection

- [listImageRowHandler](carplay/cplistimagerowitem/listimagerowhandler.md)
