-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PayID tab UI elements #2012
base: payto-base
Are you sure you want to change the base?
PayID tab UI elements #2012
Conversation
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.
This pull request does not contain a valid label. Please add one of the following labels: ['new', 'changed', 'fixed', 'removed', 'deprecated', 'chore', 'improvement']
Adyen/UI/Form/Items/Value Pickers/Identifier Picker/FormAccountIdentifierPickerItem.swift
Outdated
Show resolved
Hide resolved
} | ||
|
||
public var identifier: String { | ||
switch self { |
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.
Can be self.rawValue
?
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.
This is added in case we need different identifier from rawValue for api call.
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.
makes sense!
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.
In this case rawValue can and should be identifier. What else is there to make this enum's elements unique? Nice catch!
} | ||
|
||
let item = FormStringPickerItem( | ||
preselectedIdentifier: selectableValues[0], |
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.
Could be a crash
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.
if the selectableValues is nil?
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.
If the list is are empty accessing the first element will crash - ideally use selectableValues.first
and try to unwrap the optional
context: Dummy.context | ||
) | ||
|
||
setupRootViewController(sut.viewController) |
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.
sut.viewController.loadIfNeeded()
|
||
// MARK: - Private | ||
|
||
private func contentView(formVC: FormViewController) { |
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.
What are these used for? The function name could be a bit more descriptive
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.
It is for constructing UI but I can rename it :)
Adyen/UI/Form/Items/Value Pickers/Identifier Picker/FormStringPickerItem.swift
Outdated
Show resolved
Hide resolved
✅ No changes detectedComparing Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCashAppPay, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenWeChatPay |
|
|
||
// MARK: - Private | ||
|
||
private func payIDContentView(formVC: FormViewController) { |
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 function still does not really say what it does - based on the name I'd assume it returns a contentView but it actually appends item to the form.
Maybe instead call it func appendNameInputItems(to formVC: FormViewController)
or something similar to not have to go through the function implementation to figure out what it does.
Also if the function is only used once - it might be even ok to move the calls from the function body to the call site. So all the appending to the form happens in one place.
Summary
- Added Identifier picker UI. - Added First name input field. - Added last name input field.Ticket
COIOS-865