You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am aware that this library is not responsible of adding/removing/changing phone number formats and any request should be done at libphonenumber repo
Steps to reproduce
I'm using the PhoneNumberTextField in a SwiftUI project, so I'm wrapping it in UIViewRepresentable view. This, as I think, prevents the Country Picker View Controller from working. After all, I'm satisfied by just having the textfield and its formatting and validation capabilities.
However, this means that I have to implement a picker for country codes myself using SwiftUI, which I did. Also means that I need to set the picked country code to the PhoneNumberTextField manually.
I have a similar use-case (though it is for design reasons, not technical reasons) - our design calls for the country picker and the phone field to be separate fields. We need to call the setter for defaultRegion when the country changes.
New Issue Checklist
Steps to reproduce
I'm using the
PhoneNumberTextField
in a SwiftUI project, so I'm wrapping it inUIViewRepresentable
view. This, as I think, prevents the Country Picker View Controller from working. After all, I'm satisfied by just having the textfield and its formatting and validation capabilities.However, this means that I have to implement a picker for country codes myself using SwiftUI, which I did. Also means that I need to set the picked country code to the
PhoneNumberTextField
manually.What I did is to set it like:
Until now, it works as I expect, but I get this warning when I use
textField.defaultRegion
:I think that subclassing is not ideal for me in this case, as I need to dynamically set
defaultRegion
using my picker.Will this setter be removed in a future release?
I need a sustainable way to safely set this property without any issues.
Environment
Target platform: iOS
Library used via SPM.
The text was updated successfully, but these errors were encountered: