         }
         self.months = months
         
-        self.delegate = self
-        self.dataSource = self
+        delegate = self
+        dataSource = self
         
-        let currentMonth = NSCalendar(identifier: NSCalendar.Identifier.gregorian)!.component(.month, from: NSDate() as Date)
-        self.selectRow(currentMonth - 1, inComponent: 0, animated: false)
+        let currentMonth = Calendar(identifier: .gregorian).component(.month, from: Date())
+        selectRow(currentMonth - 1, inComponent: 0, animated: false)
     }
     
     // Mark: UIPicker Delegate / Data Source
-    
     func numberOfComponents(in pickerView: UIPickerView) -> Int {
         return 2
     }

    }
    
    func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
        let month = self.selectedRow(inComponent: 0)+1
        let year = years[self.selectedRow(inComponent: 1)]
        if let block = onDateSelected {
            block(month, year)
        }

    
    override init(frame: CGRect) {
        super.init(frame: frame)
        commonSetup()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        commonSetup()
    }
    
    func commonSetup() {
        // population years
        var years: [Int] = []
        if years.count == 0 {
            var year = Calendar(identifier: .gregorian).component(.year, from: Date())
            for _ in 1...15 {
                years.append(year)
                year += 1
