Xcode V. 8.1
iOS 10.1
Swift 3
Just add the "MySegment" file to your project.
FR76SegmentedCoctrol is subclass of UIControl as replacement of UISgmentedControl. create a UIview and assign "MySegment" class
override func viewDidLoad() {
super.viewDidLoad()
// add image
seg.imageToAdd = ["Aerosol", "Generic", "Injection", "Drop"]
// choose color
seg.colorArray = [.red ,.blue, .orange,.green]
// label title
seg.labelText = ["Aerosol", "Generic", "Injection", "Drop"]
// setUp the view
seg.setupView()}
Setup: Image position, selected/unselected label text color and label size as @IBInspectable value