  - Flexible: The segmented control item has a width equal to `totalWidth / segmentCount`
  */
 public enum XMSegmentItemWidthDistribution {
-    case Fixed
-    case HalfFixed
-    case Flexible
+    case fixed
+    case halfFixed
+    case flexible
 }
 
 @IBDesignable
-public class XMSegmentedControl: UIView {
-
-    public var delegate: XMSegmentedControlDelegate?
-    private var highlightView: UIView!
+open class XMSegmentedControl: UIView {
+
+    open var delegate: XMSegmentedControlDelegate?
+    fileprivate var highlightView: UIView!
     
     /**
      Defines the height of the highlighted edge if `selectedItemHighlightStyle` is either `TopEdge` or `BottomEdge`
      - Note: Changes only take place if `selectedItemHighlightStyle` is either `TopEdge` or `BottomEdge`
      */
-    public var edgeHighlightHeight: CGFloat = 5.0
+    open var edgeHighlightHeight: CGFloat = 5.0
     
     /// Changes the background of the selected segment.
-    @IBInspectable public var highlightColor = UIColor(red: 42/255, green: 132/255, blue: 210/255, alpha: 1) {
+    @IBInspectable open var highlightColor = UIColor(red: 42/255, green: 132/255, blue: 210/255, alpha: 1) {
         didSet {
             self.update()
         }
     }
     
     /// Changes the font color or the icon tint color for the segments.
-    @IBInspectable public var tint = UIColor.whiteColor() {
+    @IBInspectable open var tint = UIColor.white {
         didSet {
             self.update()
         }
     }
     
     /// Changes the font color or the icon tint for the selected segment.
-    @IBInspectable public var highlightTint = UIColor.whiteColor() {
+    @IBInspectable open var highlightTint = UIColor.white {
         didSet {
             self.update()
         }

     - Note: Only six elements will be displayed.
     */

    public func setupVerticalSegmentContent(content: (text: [String], icon: [UIImage])) {
        segmentContent = content

        contentType = .HybridVertical
        self.update()
    }


    /// The segment index of the selected item. When set it animates the current highlight to the button with index = selectedSegment.
    public var selectedSegment: Int = 0 {
        didSet {
            func isUIButton(view: UIView) -> Bool {
                return view is UIButton ? true : false
            }
            UIView.animateWithDuration(0.3, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.7, options: UIViewAnimationOptions.CurveEaseOut, animations: {
                switch(self.contentType) {
                case .Icon, .Hybrid, .HybridVertical:
                    ((self.subviews.filter(isUIButton)) as! [UIButton]).forEach {
                        if $0.tag == self.selectedSegment {
                            $0.tintColor = self.highlightTint

     Sets the font for the text displayed in the segmented control if `contentType` is `Text`
     - Note: Changes only take place if `contentType` is `Text`
     */
    open var font = UIFont(name: "AvenirNext-DemiBold", size: 15)!
    
    /// Sets the segmented control selected item highlight style to `Background`, `TopEdge` or `BottomEdge`.
    open var selectedItemHighlightStyle: XMSelectedItemHighlightStyle = .background
    
    /// Sets the segmented control content type to `Text` or `Icon`
    open var contentType: XMContentType = .text

    /// Sets the segmented control item width distribution to `Fixed`, `HalfFixed` or `Flexible`
    open var itemWidthDistribution:XMSegmentItemWidthDistribution = .flexible
    
    /// Initializes and returns a newly allocated XMSegmentedControl object with the specified frame rectangle. It sets the segments of the control from the given `segmentTitle` array and the highlight style for the selected item.
    public init (frame: CGRect, segmentTitle: [String], selectedItemHighlightStyle: XMSelectedItemHighlightStyle) {
