init(frame:actions:)
Creates a segmented control with the given frame and adds segments for the actions you specify.
Declaration
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 objects.
Discussion
Segments prefer images over titles when the action contains both. Selecting a segment invokes the action’s UIActionHandler, as well as handlers for the valueChanged and primaryActionTriggered control events.