Initializer

init(items:)

Initializes and returns 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) or UIImage objects (for segment images).

Return Value

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

Discussion

The returned segmented control is automatically sized to fit its content within the width of its superview.

See Also