-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(ios-text-base): button textAlignment on IOS (UIButton) #8181
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
Merged
vtrifonov
merged 5 commits into
NativeScript:master
from
sylann:fix-uibutton-textalignment
Jan 21, 2020
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f9e7da1
fix(8151): button textAlignment on IOS (UIButton)
romain20100-rwigo c3cf2ca
Merge branch 'master' into fix-uibutton-textalignment
dtopuzov 06698b3
Merge branch 'master' into fix-uibutton-textalignment
dtopuzov 0764df2
Merge branch 'master' into fix-uibutton-textalignment
sylann e5d2b3b
Merge branch 'master' into fix-uibutton-textalignment
vtrifonov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Couldn't we extract the logic of this
ifstatement to a separate function or introduce some polymorphic behavior forUIButtonas these lines are duplicated thus increasing the maintenance cost?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'm not sure it's a good idea in that case. It's only repeated twice and there is a lot of context.
Or maybe there is a bigger picture, but I don't see 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.
Why do you think it's not a good idea and what do you mean by context?
The bigger picture is that, in my opinion, the codebase is starting to have a lot of code duplications and it's getting common to fix a bug at multiple places. To mitigate this problem I think we should be conservative about adding new code duplications and refactor existing ones whenever possible.
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 you are talking about rethinking this whole file to avoid even having this if statement, I agree. But moving just this if statement in a function to avoid repeating 2 lines of code, is a perfect example of over abstraction in my opinion.
However, I do want to say that I have little experience with nativescript, since I almost just discovered this project. So I don't pretend to have a genuine opinion in here. I'm just sharing my "general experience" on what looks like a lot of work for a not so important abstraction.
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.
Alright then, I'll approve your changes. We'd perhaps refactor this whole file so we'll abstract stuff at a later point. Thank you for the contribution :)