<!--
{
  "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/init(frame:actions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISegmentedControl(im)initWithFrame:actions:"
  },
  "title" : "init(frame:actions:)"
}
-->

# init(frame:actions:)

Creates a segmented control with the given frame and adds segments for the actions you specify.

```
convenience init(frame: CGRect, actions: [UIAction])
```

## Parameters

`frame`

A rectangle that specifies the segmented control’s frame in a superview’s coordinate system.

`actions`

An array of [`UIAction`](/documentation/UIKit/UIAction) objects.

## Discussion

Segments prefer images over titles when the action contains both. Selecting a segment invokes the action’s [`UIActionHandler`](/documentation/UIKit/UIActionHandler), as well as handlers for the [`valueChanged`](/documentation/UIKit/UIControl/Event/valueChanged) and [`primaryActionTriggered`](/documentation/UIKit/UIControl/Event/primaryActionTriggered) control events.

---

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)