---
title: "setPointsOfInterest(_:selectedIndex:)"
framework: carplay
role: symbol
role_heading: Instance Method
path: "carplay/cppointofinteresttemplate/setpointsofinterest(_:selectedindex:)"
---

# setPointsOfInterest(_:selectedIndex:)

Updates the points of interest and the current selection.

## Declaration

```swift
func setPointsOfInterest(_ pointsOfInterest: [CPPointOfInterest], selectedIndex: Int)
```

## Parameters

- `pointsOfInterest`: An array that contains the points of interest the template displays.
- `selectedIndex`: The selection’s index. This is the array’s index for the specific point of interest you want to select. Use doc://com.apple.documentation/documentation/Foundation/NSNotFound-4qp9h to indicate no initial selection.

## Discussion

Discussion pointsOfInterest can contain a maximum of twelve points of interest because that is the most the template displays.

## See Also

### Managing the Points of Interest

- [pointsOfInterest](carplay/cppointofinteresttemplate/pointsofinterest.md)
- [selectedIndex](carplay/cppointofinteresttemplate/selectedindex.md)
