-
Notifications
You must be signed in to change notification settings - Fork 11
[SIWA] Add methods to create WP account #116
Conversation
frosty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment, otherwise looks great!
| guard let name = components else { | ||
| return "" | ||
| } | ||
| return PersonNameComponentsFormatter().string(from: name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know PersonNameComponentsFormatter but I wonder if we should use the static localizedString method and specify the style of name
PersonNameComponentsFormatter.localizedString(from: components,
style: .medium,
options: [])
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default style is medium, so specifying that shouldn't be necessary. But, ya, I should have used localizedString. Thanks. I'll change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, reading the documentation again, I don't think a change is necessary. string seems to return the name in the correct style for the language. localizedString is for specifying the format and options. Which we don't need to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, great! Thanks for reading the docs 😅
Related WPKit PR: wordpress-mobile/WordPressKit-iOS#181
This adds methods to create a WordPress account by sending Apple ID credentials to the method added in the above WPKit PR.
This can be tested with WPiOS PR: wordpress-mobile/WordPress-iOS#12350