<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSegmentedControl/init(images:trackingMode:target:action:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSegmentedControl(cm)segmentedControlWithImages:trackingMode:target:action:"
  },
  "title" : "init(images:trackingMode:target:action:)"
}
-->

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

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

```
convenience init(images: [NSImage], trackingMode: NSSegmentedControl.SwitchTracking, target: Any?, action: Selector?)
```

## Parameters

`images`

An array of image objects 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

An initialized segmented control.

## Discussion

To ensure accessibility for this control, set the `accessibilityDescription` property on each of the provided images.

---

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)