WhisperSystems/TextSecure-iOS — pull request #87 by troyjfarrell (2014-02-27 19:01:52+00:00)
Title: Add tests and clean up some country code UI

This set of commits resolves the bad behavior and exceptions thrown from VerificationViewController when the user leaves the country code text input blank. Specifically, if no country code is set, a certain set of numbers entered by the user can cause an NSRangeException to be raised:

1) Touch the country code field.
2) Touch the phone number field. Note that the country code field contains only '+'.
3) Touch the '2' key until the NSRangeException is raised.

This set of commits adds an NSAssert to make clear the code's assumption that a country code will always be present. (It does not check the validity of the country code, which is an area for future work.) It also adds logic to the countryCodeInput UITextInput to restore the previous country code is the input is touched, but no new value is entered. The phoneNumber UITextField is now selected after the user picks a country from the CountryViewController.

Also included are several trivial changes to make the files conform to the style guides.