An updated version (Swift 4.2 compatible) for this customized Segmented Control for iOS based on 2014 Tope Abayomi 's implementation
1.- Import in your project
2.- On your storyboard add a new UIView
3.- Change it's class to AdvancedSegmentedControl
4.- Adjust propertis as you want
5.- Assing the "valueChanged" IBAction to your class
6.- Ask for the "selectedIndex" property
7.- Enjoy!