Contents

init(items:)

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

Declaration

init(items: [Any]?)

Parameters

  • items:

    An array of Nsstring objects (for segment titles), Uiimage objects (for segment images), or in iOS 14.0 and later 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.

See Also

Creating a segmented control