             return super.layoutSubviews()
         }
         
-        if !labelsConfigured {
-            configureLabels()
-        }
+        layoutTitleLabelsIfNeeded()
         
         // Pretend that our height without title
         frame.size.height -= titleHeight
+        defer {
+            frame.size.height += titleHeight
+        }
         
+        // UIPickerView behaviour observes:
+        // 1. super.layoutSubviews() will never touch subviews' frame.origin.y
         super.layoutSubviews()
+
+        // Determine whether adjusted subviews
+        guard let bodyView = subviews.first where bodyView.frame.origin.y != titleHeight else {
+            return
+        }
         
-        // Recover pretending
-        for view in subviews {
-            if view.tag >= kTitleTag && view.tag < kTitleTag + titles.count {
-                // Do nothing for title labels
-                continue
-            }
-            
-            // Move picker views down
-            view.frame.origin.y += titleHeight
-        }
-        frame.size.height += titleHeight
+        // Move down all subviews except titles
+        subviews
+            .filter  { !$0.isKindOfClass(UILabel) }
+            .forEach { $0.frame.origin.y += titleHeight }
     }
-    
+
     public override func intrinsicContentSize() -> CGSize {
         // Update prefer size
         var size = super.intrinsicContentSize()

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
        }
    }
    
