Skip to content

Commit ad5b05d

Browse files
authored
VisualInstructionDelegate method calls fix (#4820)
* NAVIOS-2142-delegate-calls: added checks to avoid unnecessary calls; CHANGELOG udpated
1 parent b59c893 commit ad5b05d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
### Other changes
1010

1111
* Added `RouteControllerNotificationUserInfoKey.shouldPlayRerouteSoundKey` to the user info dictionary of `Notification.Name.routeControllerDidReroute` notification. ([#4822](https://github.com/mapbox/mapbox-navigation-ios/pull/4822))
12+
* Fixed a bug with excessive `VisualInstructionDelegate.label(_:willPresent:as:)` delegate method call during initialization.
1213

1314
## v2.20.4
1415

1516
### Other changes
1617

1718
* Reroute notification sound now plays only after a new route is successfully retrieved.
19+
* Fixed a bug with excessive `VisualInstructionDelegate.label(_:willPresent:as:)` delegate method call during initialization.
1820

1921
## v2.20.3
2022

Sources/MapboxNavigation/StylableLabel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,28 @@ open class StylableLabel: UILabel {
77
// Workaround the fact that UILabel properties are not marked with UI_APPEARANCE_SELECTOR.
88
@objc dynamic open var normalTextColor: UIColor = .black {
99
didSet {
10+
guard normalTextColor != oldValue else { return }
1011
update()
1112
}
1213
}
1314

1415
@objc dynamic open var normalFont: UIFont = .systemFont(ofSize: 16) {
1516
didSet {
17+
guard normalFont != oldValue else { return }
1618
update()
1719
}
1820
}
1921

2022
@objc dynamic public var textColorHighlighted: UIColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) {
2123
didSet {
24+
guard textColorHighlighted != oldValue else { return }
2225
update()
2326
}
2427
}
2528

2629
@objc public var showHighlightedTextColor: Bool = false {
2730
didSet {
31+
guard showHighlightedTextColor != oldValue else { return }
2832
update()
2933
}
3034
}

0 commit comments

Comments
 (0)