Issue 62 from original code

https://github.com/HeshamMegid/HMSegmentedControl/issues/62