---
title: "isEnabled(forSegment:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nssegmentedcontrol/isenabled(forsegment:)"
---

# isEnabled(forSegment:)

Returns a Boolean value indicating whether the specified segment is enabled.

## Declaration

```swift
func isEnabled(forSegment segment: Int) -> Bool
```

## Parameters

- `segment`: The index of the segment whose enabled state you want to get. This method raises an exception (doc://com.apple.documentation/documentation/Foundation/NSExceptionName/rangeException) if the index is out of bounds.

## Return Value

Return Value true if the segment is enabled; otherwise, false.

## See Also

### Enabling and disabling segments

- [setEnabled(_:forSegment:)](appkit/nssegmentedcontrol/setenabled(_:forsegment:).md)
