---
title: "eventFor(indexPath:)"
framework: CareKit
role: symbol
role_heading: Instance Method
platforms: [iOS 13.0+, Mac Catalyst 13.0+, watchOS 7.0+]
path: "carekit/ocktaskcontroller/eventfor(indexpath:)"
---

# eventFor(indexPath:)

Returns the event at a specific index path from a task view controllers’ collection view.

## Declaration

```swift
func eventFor(indexPath: IndexPath) -> OCKAnyEvent?
```

## Parameters

- `indexPath  `: The location of the event in the task view controllers’ collection view.

## See Also

### Handling Task Selection

- [appendOutcomeValue(withType:at:completion:)](carekit/ocktaskcontroller/appendoutcomevalue(withtype:at:completion:).md)
- [initiateDetailsViewController(forIndexPath:)](carekit/ocktaskcontroller/initiatedetailsviewcontroller(forindexpath:).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)
