         selectRow(selectedMonth - 1, inComponent: 0, animated: false)
     }
     
+    //MARK:- UIPickerView Delegates & DataSource
+    
     func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
+        
         switch component{
         case 0:
             return months[row % months.count]
         case 1:
             return String(days[row % days.count])
+        case 2:
+            return String(years[row])
         default:
             return ""
         }

        commonInit()
    }
    
    func commonInit(){
        delegate = self
        showsSelectionIndicator = true
        
        let currentMonth = 11
        let currentDate = 25
        let half = maxElements / 2


import UIKit

public class VJDateComponents {

}

public enum VJDatePickerType : String {
    
    case Default
    case DayOnly
    case MonthOnly
    case YearOnly
    case YearMonth
    case MonthDay
}

class VJDatePicker: UIPickerView, UIPickerViewDataSource, UIPickerViewDelegate {
    
    var initialComponents : VJDateComponents?
    
    var minimumYearValue : Int!
    var maximumYearValue : Int!
    
    private var selectedComponents : VJDateComponents{
        return self.selectedComponents
    }
    
    var datePickerType: VJDatePickerType = .Default{
        didSet{
            reloadAllComponents()
        }
    }
    
    private var maxElements = Int(INT16_MAX)
    
    private var days : Array<Int>{
        var dayArray = Array<Int>()
        for day in 1...31{
            dayArray.append(day)
        }
        return dayArray
    }
    private let months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
    
    private var years : Array<Int>{
        var yearArray = Array<Int>()
        var minYear : Int = 1970
        var maxYear : Int = 2016
        if let _ = minimumYearValue{
            minYear = minimumYearValue!
        }
        if let _ = maximumYearValue{
            maxYear = maximumYearValue!
        }
        for year in minYear...maxYear{
            yearArray.append(year)
        }
        return yearArray
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
