---
title: "init(labels:trackingMode:target:action:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nssegmentedcontrol/init(labels:trackingmode:target:action:)"
---

# init(labels:trackingMode:target:action:)

Creates a standard segmented control containing one segment for each of the provided labels.

## Declaration

```swift
convenience init(labels: [String], trackingMode: NSSegmentedControl.SwitchTracking, target: Any?, action: Selector?)
```

## Parameters

- `labels`: An array of localized label strings to use for the control’s segments.
- `trackingMode`: The selection mode for the control. The NSSegmentSwitchTracking enum describes the possible values and their effects.
- `target`: The target object that receives action messages from the control.
- `action`: The action message sent by the control.

## Return Value

Return Value An initialized segmented control.

## See Also

### Creating a segmented control

- [init(images:trackingMode:target:action:)](appkit/nssegmentedcontrol/init(images:trackingmode:target:action:).md)
