|
|
@ -18,7 +18,7 @@ class ForgotPasswordViewController: UIViewController { |
|
|
|
// MARK: Properties |
|
|
|
|
|
|
|
var presenter: ForgotPasswordModuleInterface? |
|
|
|
|
|
|
|
let datePicker = UIDatePicker() |
|
|
|
|
|
|
|
// MARK: VC's Life cycle |
|
|
|
|
|
|
@ -41,7 +41,21 @@ class ForgotPasswordViewController: UIViewController { |
|
|
|
|
|
|
|
private func setup() { |
|
|
|
// all setup should be done here |
|
|
|
|
|
|
|
self.setupDatePicker() |
|
|
|
self.setupPicturedNavBar() |
|
|
|
} |
|
|
|
|
|
|
|
private func setupDatePicker() { |
|
|
|
self.datePicker.datePickerMode = .date |
|
|
|
self.dobTextField.inputView = datePicker |
|
|
|
datePicker.maximumDate = Date() |
|
|
|
self.datePicker.addTarget(self, action: #selector(handleDatePicker(sender:)), for: .valueChanged) |
|
|
|
} |
|
|
|
|
|
|
|
@objc private func handleDatePicker(sender: UIDatePicker) { |
|
|
|
let dateFormatter = DateFormatter() |
|
|
|
dateFormatter.dateFormat = "dd/MM/yyyy" |
|
|
|
self.dobTextField.text = dateFormatter.string(from: sender.date) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|