Classes
The following classes are available globally.
-
Get version string of the Sinch Verification SDK
See moreDeclaration
Swift
open class SinchVerification
-
TextFieldPhoneNumberFormatter is a helper to perform As-You-Type-Formatting on a UITextField. The formatter performs formatting based on the region country code given at initialization.
Example usage:
See morelet textField = TextField.init(...); let isoCountryCode = DeviceRegion.currentCountryCode(); let formatter = TextFieldPhoneNumberFormatter(countryCode: isoCountryCode); formatter.textField = textField; textField.placeholder = formatter.exampleNumber(format:PhoneNumberFormat.National); formatter.onTextFieldTextDidChange = { (textField: UITextField) -> Void in let text = textField.text != nil ? textField.text! : ""; let util = SharedPhoneNumberUtil(); let isPossible = util.isPossibleNumber(textField.text, fromRegion: isoCountryCode); // Update GUI to hint whether current // user input is a viable phone number. }
Declaration
Swift
public final class TextFieldPhoneNumberFormatter