Migrate from PhoneNumberKit 0.x to 1.0
masterThe 1.0 release introduces breaking changes to align with Swift 3.0 API standards. The primary change is the introduction of the PhoneNumberKit object as the central coordinator for parsing and formatting, replacing the previous pattern of using a PhoneNumber object directly for these tasks.
Key changes:
- Centralized Object: Use a
PhoneNumberKitinstance to perform parsing and formatting. - Lifecycle Management:
PhoneNumberKitobjects are relatively expensive to allocate; you should create one instance and reuse it throughout your application lifecycle. - Strong Validation: In 1.0, type validation is performed during the parsing process. All
PhoneNumberobjects are now strongly validated by default, whereas 0.x used computed properties that provided 'light' validation.