Last active
March 3, 2018 04:45
-
-
Save nic004/31ea29f431507cc5a91ef4af54efaedf to your computer and use it in GitHub Desktop.
phone number verification without Reactive #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @IBAction func requestVerifyNumberAction(_ sender: Any) { | |
| guard let phoneNumber = phoneTextField.text else { return } | |
| api.postUsersVerify(phoneNumber: phoneNumber).on(value: { _ in | |
| self.verifyStep = .inputVerifyNumber | |
| }) | |
| } | |
| @IBAction func verifyAction(_ sender: Any) { | |
| guard let phoneNumber = phoneTextField.text, let code = verifyNumberTextField.text else { return } | |
| api.getUsersVerify(PhoneNumberVerifyParams(phone_number: phoneNumber, code: code)) | |
| .on(value: { _ in | |
| self.verifyStep = .succeed | |
| }) | |
| .on(failed: { error in | |
| self.verifyStep = .failed | |
| }) | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment