<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISegmentedControl/segmentIndex(identifiedBy:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISegmentedControl(im)segmentIndexForActionIdentifier:"
  },
  "title" : "segmentIndex(identifiedBy:)"
}
-->

# segmentIndex(identifiedBy:)

The index of a segment with an action that has an identifier matching the identifier you specify.

```
func segmentIndex(identifiedBy actionIdentifier: UIAction.Identifier) -> Int
```

## Parameters

`actionIdentifier`

The [`UIAction.Identifier`](/documentation/UIKit/UIAction/Identifier-swift.struct) to match.

## Return Value

The index of the segment with an action that has a matching identifier, or <doc://com.apple.documentation/documentation/Foundation/NSNotFound-4qp9h> if no matching action is found.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)