         let yearText = textInRange(match.rangeAtIndex(2))
         month = Int(monthText)
         year = Int(yearText)
+        
+        dump("month: \(month) year: \(year)")
     }
-    
-//    func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {
-//        if string == separator {
-//            return false
-//        }
-//        
-//        if string.characters.count == 0 && range.length == 1 {
-//            if range.location == maxLength {
-//                deleteBackward()
-//            }
-//        }
-//        
-//        if(range.length + range.location > maxLength) {
-//            return false
-//        }
-//        
-//        return true
-//    }
     
     private func textInRange(range: NSRange) -> String {
         let text = self.text ?? ""

        placeholder = "MM/YY"
        let expiryDatePicker = CardExpiryDatePicker() // TODO: Use normal picker delegate.
        expiryDatePicker.onDateSelected = { [weak self] (month: Int, year: Int) in
            self.text = String(format: "%02d/%d", month, year-2000)
            self.month = month
            self.year = year
        }
        inputView = expiryDatePicker
    }

import UIKit

public class CardExpiryDateTextField: OmiseTextField {
    private let maxCreditCardAge = 21
    private let expirationRx = { () -> NSRegularExpression in
        let options = NSRegularExpressionOptions(rawValue: 0)
        guard let rx = try? NSRegularExpression(pattern: "^(\\d{1,2})/(\\d{1,2})$", options: options) else {
