• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    Swift
  • Created over 7 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Custom Segmented Control in Swift

A Swift 5 version of Custom Animated Segmented Control

alt text

Install

Drag and drop HBSegmentedControl.swift file to your project and assign it to a view from storyboard

Customization

  segmentControl.items = ["Weekly", "Fornightly", "Monthly"]
  segmentControl.borderColor = .clear
  segmentControl.selectedLabelColor = .white
  segmentControl.unselectedLabelColor = .red
  segmentControl.backgroundColor = .lightGray
  segmentControl.thumbColor = .black
  segmentControl.selectedIndex = 1
  segmentControl.addTarget(self, action: #selector(segmentValueChanged(_:)), for: .valueChanged)

Attribution

Much of the information was gleaned from appdesignvault.