Closed davidkessler-ch closed 1 week ago
How can I set a maxDigits value that is given by the longest possible valid phone number of the selected country?
maxDigits
I have tried:
iPhoneNumberField(nil, text: $number, isEditing: $editing) { $0.maxDigits = PhoneNumberKit() .possiblePhoneNumberLengths(forCountry: $0.currentRegion, phoneNumberType: .fixedOrMobile, lengthType: .national) .sorted(by: { $0 > $1 }) .first }
Turns out I just chose the wrong phoneNumberType and lengthType. It would still be nice to have a way of getting the longest out of all options with a single call.
phoneNumberType
lengthType
How can I set a
maxDigits
value that is given by the longest possible valid phone number of the selected country?I have tried: