IconTabsSegmentControl - admiral-team/admiralui-ios GitHub Wiki

Class

A horizontal control made of multiple segments with icons.


Declaration

public class IconTabsSegmentControl: UIControl, AnyAppThemable

Overview

A horizontal control is a linear set of two or more segments, each of which functions as a circle button with image and text. Use a segmented control to provide closely related choices that affect an object, state, or view.

Configure an Icon tabs segment control

Configuration an icon tabs segment control the similar UISegmentedControl, but for useful we added constructor with title and image.

let segmentControl = IconTabsSegmentControl(items: [
   IconTab(title: "One", image: Asset.IconTabs.mobile.image),
   IconTab(title: "Two", image: Asset.IconTabs.card.image)]
)
segmentControl.selectedSegmentIndex = 0

Handle a selection

You register the target-action methods for a segmented control using the valueChanged.

segmentControl.addTarget(self, action: #selector(segmentedValueChanged), for: .valueChanged)

Contribution

You can help us to find bugs or ask us to add features.

  • To start issue please use ready-made templates.
  • To make changes to the repository, you need to create a fork of the project, make changes to the code and create a pull request in our project. You can read more about this in the Github documentation.