Skip to content

Instantly share code, notes, and snippets.

@nic004
Last active March 3, 2018 04:45
Show Gist options
  • Select an option

  • Save nic004/31ea29f431507cc5a91ef4af54efaedf to your computer and use it in GitHub Desktop.

Select an option

Save nic004/31ea29f431507cc5a91ef4af54efaedf to your computer and use it in GitHub Desktop.
phone number verification without Reactive #3
@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