iOS App for managing cryptocurrency
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Assets
CryptoWallet.xcodeproj
CryptoWallet.xcworkspace
CryptoWallet
CryptoWalletTests
CryptoWalletUITests
Pods
Podfile
Podfile.lock
ReadMe.md

ReadMe.md

CryptoWallet

iOS app for managing your cryptocurrency

By Zaid Al Rakabi

Build Status

Description

For this app I have so far implemented the phone verification for CryptoWallet. Currently the app functions by taking in as input a US phone number. Then it parses, formats, and checks the number using the libPhoneNumberiOS library. If the phone number is accurate an alert message is displayed saying that a verification code will be sent. Otherwise an error alert is printed to try again.

Tech

Functions

VerifyPressed()
  • Action for the Verify Button to check the phone number the user has input
  • Has do() catch() for error handling
  • Gets phoneField input and validates using: parse(), format(),isValidNumber() from the libPhoneNumber-iOS library
  • If the Action is not valid throws an error and alerts the user using: catchError, setGenerateAlert()
catchError()
  • checks the return of   isValidNumber()
  • if the phone Number is not valid then throws an invalidPhoneNumber error
setGenerateAlert()
  • Initializes new UIAlertController with the passes in alertTitle and Message
  • Then adds an action through   .addAction() to generate a UIAlertAction as an OK button to cancel the alert.
touchesBegan()
  • Once the user touches away from phone number field it goes away by using   .resignFirstResponder()
textField()
  • Function in the Extension of the UITextFieldDelegate
  • Takes whatever is being input into the text field and formats it continouously using the   format() function
format()
  • Function to format 10 digit phone numbers continuously
  • formats the number by checking the digits and calling   replacingOccurrences()