A simple and easy to use view controller enabling you to enter a phone number with a country code similar to WhatsApp
- 1: Create the PhoneNumberViewController
let phoneNumberViewController = PhoneNumberViewController.standardController()
- 2: Set delegate (optional)
phoneNumberViewController.delegate = self
- 3: Present the PhoneNumberViewController (Modally)
presentViewController(phoneNumberViewController, animated: true, completion: nil)
- 4: Present the PhoneNumberViewController (Navigation Controller)
phoneNumberViewController.cancelBarButtonItemHidden = true
navigationController?.pushViewController(phoneNumberViewController, animated: true)
You can respond to delegate methods using the PhoneNumberViewControllerDelegate
protocol
You can manually present a CountriesViewController
to present a list of all countries and their phone extensions to the user