---
title: "initiateDetailsViewController(forIndexPath:)"
framework: CareKit
role: symbol
role_heading: Instance Method
platforms: [iOS 13.0+, Mac Catalyst 13.0+, watchOS 7.0+]
path: "carekit/ocktaskcontroller/initiatedetailsviewcontroller(forindexpath:)"
---

# initiateDetailsViewController(forIndexPath:)

Returns a detail view controller to display for the task the user selected.

## Declaration

```swift
func initiateDetailsViewController(forIndexPath indexPath: IndexPath) throws -> OCKDetailViewController
```

## Parameters

- `indexPath  `: The location in the collection view of the item the user selected.

## See Also

### Handling Task Selection

- [appendOutcomeValue(withType:at:completion:)](carekit/ocktaskcontroller/appendoutcomevalue(withtype:at:completion:).md)
- [eventFor(indexPath:)](carekit/ocktaskcontroller/eventfor(indexpath:).md)
- [initiateDeletionForOutcomeValue(atIndex:eventIndexPath:deletionCompletion:)](carekit/ocktaskcontroller/initiatedeletionforoutcomevalue(atindex:eventindexpath:deletioncompletion:).md)
- [makeOutcomeFor(event:withValues:)](carekit/ocktaskcontroller/makeoutcomefor(event:withvalues:).md)
- [setEvent(atIndexPath:isComplete:completion:)](carekit/ocktaskcontroller/setevent(atindexpath:iscomplete:completion:).md)
