| | |
| | | |
| | | guard !tf_name.text!.isEmpty else {alertError(msg: tf_name.placeholder!);return} |
| | | guard !tf_birthday.text!.isEmpty else {alertError(msg: "请选择生日");return} |
| | | guard !tf_gender.text!.isEmpty else {alertError(msg: "请选择性别");return} |
| | | guard !tf_height.text!.isEmpty else {alertError(msg: tf_height.placeholder!);return} |
| | | guard !tf_weight.text!.isEmpty else {alertError(msg: tf_weight.placeholder!);return} |
| | | guard tf_height.text != "0" else {alertError(msg: "请输入正确的身高");return} |
| | |
| | | extension AddStudentVC:UITextFieldDelegate{ |
| | | func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { |
| | | if textField == tf_birthday{ |
| | | view.endEditing(true) |
| | | CommonDatePickerView.show(before: 18, after: 0, type: .YMD) { year, month, day,_,_ in |
| | | textField.text = String(format: "%ld-%02ld-%02ld", year!,month!,day!) |
| | | } |