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

# event(forIndexPath:)

Returns the event at an index path, where the section represents the task and the item corresponds to the event index.

## Declaration

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

## Parameters

- `indexPath  `: The index path for the event.

## Return Value

Return Value

## See Also

### Fetching Events

- [events(forSection:)](carekit/ocktaskevents/events(forsection:).md)
- [firstEvent](carekit/ocktaskevents/firstevent.md)
- [firstEvents](carekit/ocktaskevents/firstevents.md)
