<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISegmentedControl/init(items:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISegmentedControl(im)initWithItems:"
  },
  "title" : "init(items:)"
}
-->

# init(items:)

Creates a segmented control with segments having the given titles or images.

```
init(items: [Any]?)
```

## Parameters

`items`

An array of <doc://com.apple.documentation/documentation/Foundation/NSString> objects (for segment titles), [`UIImage`](/documentation/UIKit/UIImage) objects (for segment images), or in iOS 14.0 and later [`UIAction`](/documentation/UIKit/UIAction) objects.

## Return Value

A `UISegmentedControl` object or `nil` if there was a problem in initializing the object.

## Discussion

The system automatically sizes the returned segmented control to fit its content within the width of its superview.

---

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)