 		super.viewWillDisappear(animated)
 		
 		notificationToken?.stop()
+	}
+}
+
+extension ProductViewController {
+	func expirationDateChanged(_ sender: UIDatePicker) {
+		let datePicker = expirationDateTextField.inputView! as! UIDatePicker
+		let expirationDate = datePicker.date
+		setExpirationDateText(with: expirationDate)
 	}
 }
 

			
		} else if textField == priceTextField {
			var price: Double? = nil
			if  let priceString = priceTextField.text {
				price = Double(currencyFormatter!.number(from: priceString)!)
			}
			

		dateFormatter!.dateStyle = .short
		dateFormatter!.timeStyle = .none
		
		let datePicker = UIDatePicker()
		datePicker.datePickerMode = .date
		datePicker.addTarget(self, action: #selector(expirationDateChanged(_:)), for: .valueChanged)
		expirationDateTextField.inputView = datePicker
		
		brandTextField.text = product!.brand
		nameTextField.text = product!.name
		setPriceText(with: product!.price)
