FUISegmentControl

@MainActor
open class FUISegmentControl : UISegmentedControl, FUIAttributedStringDrawing

A UISegmentedControl subclass with Fiori styles.

Usage:

let segmentControl = FUISegmentControl(items: ["Segment 1", "Segment 2", "Segment 3"])
segmentControl.addTarget(self, action: #selector(selectionChange(segmentControl:)), for: .primaryActionTriggered)

Use segment control in a container with dark background

segmentControl.backgroundColorScheme = .darkConstant

Theming

fdlFUISegmentControl {
   background-color (Color)
   background-image { -selected | -highlighted | -disabled } (Image)

   tint-color (Color)
   selected-segment-tint-color (Color)

   // The divider image to be used when both left and right segment are in normal state
   divider-image (Image)

   font-color { -selected | -highlighted | -disabled } (Color)

   text-shadow-color { -selected | -highlighted | -disabled } (Color)
   text-shadow-offset { -selected | -highlighted | -disabled } (Size)

   font-name { -selected | -highlighted | -disabled } (FontName)
   font-size { -selected | -highlighted | -disabled } (Size)
   font-style { -selected | -highlighted | -disabled } (UIFont.TextStyle)
}
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override var isAccessibilityElement: Bool { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override var accessibilityElements: [Any]? { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override var selectedSegmentIndex: Int { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override func insertSegment(withTitle title: String?, at segment: Int, animated: Bool)
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override func insertSegment(with image: UIImage?, at segment: Int, animated: Bool)
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override func removeSegment(at segment: Int, animated: Bool)
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override func removeAllSegments()
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override func setTitle(_ title: String?, forSegmentAt segment: Int)
  • Undocumented

    Declaration

    Swift

    @MainActor
    open override func setImage(_ image: UIImage?, forSegmentAt segment: Int)