@uliwitness I don’t need String <-> Beautiful String. I need String <-> Structured Phone Number Data, and I need this done in a way that let’s the user edit the country prefix in a separate SwiftUI Picker. And did I mention that we only support a subset of all country prefixes?
@gernot@uliwitness If the parser is good enough, sounds like a somewhat simple transformation using a view model (name used intentionally and properly this time), though?
@ctietze@uliwitness Say a User has +49 123 1234. Changes the prefix to +43. What to do then? (PhoneNumber.countrycode is not mutable, PhoneNumber has no initializers exept being returned from a formatter)
@ctietze@uliwitness There are other super crazy design decisions. PartialFormatter class that doesn’t conform to the Formatter protocol. The fact that their actual PhoneNumberFormatter does, but needs a „generatedPhoneNumber = true“, because its default mode is NOT doing formatting to PhoneNumber (and it silently fails in SwiftUI Textfields). And there is a Class called „Formatter“ in the framework that is not Foundations’ Formatter. (1/2)
@ctietze@uliwitness Replacing the +49 with +43 on the String is NOT what I want, because avoiding this stuff is why I want to use PhoneNumberKit in the first place.
Add comment