-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
@frederoni, thanks for your PR! By analyzing this pull request, we identified @incanus, @1ec5 and @boundsj to be potential reviewers. |
if (!_debugLabel) { | ||
_debugLabel = [[UILabel alloc] init]; | ||
_debugLabel.font = [UIFont systemFontOfSize:8]; | ||
[self addSubview:_debugLabel]; |
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.
A label means you'd have to manage constraints internal to this view. That may be a good idea, but consider whether it might be easier to override -drawInRect: and use Core Graphics and attributed string drawing methods to accomplish the same effect, since you don't need to worry about line wrapping.
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 prefer to use -drawInRect: when I want instant rendering instead of default animation between layouts otherwise I prefer -layoutSubviews. Working directly with the views also improves readability but I haven't really decided yet. The logic should be the same so we can switch to Core Graphics if we don't get the expected behavior without much fuss.
|
||
- (instancetype)init { | ||
if (self == [super init]) { | ||
_formatter = [[NSLengthFormatter alloc] init]; |
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.
We should use MGLDistanceFormatter once #3331 is implemented. NSLengthFormatter is suboptimal because, when the system is set to U.S. units, it tends to use yards instead of feet or fractional miles, whereas Americans find yards difficult to relate to (except in football).
Closing in favor of #7631 |
WIP #1278