-
Notifications
You must be signed in to change notification settings - Fork 36
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
Dropping Objective-C Support (v5.0.0) #230
Conversation
Hotfix: 4.24.3
… class name field
[Dev -> Master] 4.25.0
…tibility typedefs
Co-authored-by: Daniel Fowler <daniel@opn.ooo>
Co-authored-by: Daniel Fowler <daniel@opn.ooo>
Update OCBC Digital logo
Fix storyboard link to new OCBC icon
Bump Client version to 4.25.1
[Dev -> Master] 4.25.1
Add payment method Truemoney JumpApp
Filter Truemoney Wallet / TrueMoney payment methods
} else { | ||
return Locale.current.regionCode | ||
} |
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.
} else { | |
return Locale.current.regionCode | |
} | |
} | |
return Locale.current.regionCode |
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's a copy-pasted Objective-C file rewritten with Swift without much refactoring tho I'd still keep it this way as it's make it more clear to read the code and identify the intention in this specific case.
} else { | ||
return 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.
} else { | |
return nil | |
} | |
} | |
return 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.
Same as above, if there clear if/else scenario then most of the time this syntax is much faster to read and understand. And then if you would like to add more code there you have less chance place a code in a wrong place. Again in cases like that I prefer to have a clear vision of developer intension. Not always, but here it looks ok to me.
if let sourceType = SourceTypeValue(value) { | ||
self = .source(sourceType) | ||
} else { | ||
self = .unknown(sourceType: value) | ||
} |
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.
WDYT about using ternary operator?
if let sourceType = SourceTypeValue(value) { | |
self = .source(sourceType) | |
} else { | |
self = .unknown(sourceType: value) | |
} | |
let sourceType = SourceTypeValue(value) | |
self = sourceType ? .source(sourceType) : unknown(sourceType: value) |
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't be done here, swift's if let nonOptionalVarA = optionalVarA { }
turns optional to non-optional inside the block and goes to else
if it's nil
. You example won't be compiled as .source(sourceType)
can't be nil
here (case unknown(sourceType: String)
)
self.paymentAmount = Tool.japanPaymentAmount | ||
self.paymentCurrencyCode = Tool.japanPaymentCurrency | ||
self.allowedPaymentMethods = Tool.japanAllowedPaymentMethods | ||
case "SG": |
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 about EN locale? Is it supposed to be same as SG and hence just ommitted?
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.
There's a default
block for everything else including EN just below:
default:
self.paymentAmount = Tool.thailandPaymentAmount
self.paymentCurrencyCode = Tool.thailandPaymentCurrency
self.allowedPaymentMethods = Tool.thailandAllowedPaymentMethods
typealias ControlState = UIControl.State
)truemoney_jumpapp
to capability.json mockup for unit tests