         selectionBackgroundView!.backgroundColor = color
     }
 }
-
-
-

import UIKit


let kTitleTag = 0x90df00d
let kTitleHeight: CGFloat = 34.5

public class CKPickerView: UIPickerView {

    
    // MARK: - Private Implementations
    
    private var titleLabels = [UILabel]()

    private var selectionIndicators = [UIView]()

    private var selectionBackgroundView: UIView?
    
    private func updateIndicatorsColor() {
        for view in selectionIndicators {
            view.backgroundColor = selectionIndicatorColor
        }
    }
    
    private func layoutTitleLabelsIfNeeded() {
        
        // Do not need layout if no titles are set
        guard !attributedTitles.isEmpty else {
            return
        }
        
        // Initialize titleLabel if does not
        if titleLabels.isEmpty {
            for title in attributedTitles {
                let label = UILabel()
                label.attributedText = title
                label.textAlignment = .Center
                
                titleLabels.append(label)
                addSubview(label)
            }
        }
    
        // Layout
        for (i, label) in titleLabels.enumerate() {
            let width: CGFloat = frame.width / CGFloat(titleLabels.count)
            label.frame.origin.x = 0 + width * CGFloat(i)
            label.frame.origin.y = 0
            label.frame.size.width = width
            label.frame.size.height = titleHeight
        }
    }
    
