Skip to content

Commit 8ddde1a

Browse files
committed
Add the ability to set locale for top and bottom banner views
1 parent bbbfac3 commit 8ddde1a

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
### User interface
2323

2424
* `SpeedLimitView` now shows a special "Limits no longer apply" sign on roads where speed limit is known to not exist. ([#4584](https://github.com/mapbox/mapbox-navigation-ios/pull/4584))
25+
* `TopBannerViewController.delegate` and `TopBannerViewController.instructionsBannerView` are now public. ([#4595](https://github.com/mapbox/mapbox-navigation-ios/pull/4595))
26+
* `BottomBannerViewController.dateFormatter`, `BottomBannerViewController.dateComponentsFormatter`, `BottomBannerViewController.distanceFormatter` and `InstructionsBannerView.distanceFormatter` are now public. ([#4595](https://github.com/mapbox/mapbox-navigation-ios/pull/4595))
2527

2628
### Other changes
2729

Sources/MapboxNavigation/BottomBannerViewController.swift

+9-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ open class BottomBannerViewController: UIViewController, NavigationComponent {
1212
var previousProgress: RouteProgress?
1313
var timer: DispatchTimer?
1414

15-
let dateFormatter = DateFormatter()
16-
let dateComponentsFormatter = DateComponentsFormatter()
17-
let distanceFormatter = DistanceFormatter()
18-
15+
/// Arrival date formatter for banner view.
16+
public let dateFormatter = DateFormatter()
17+
18+
/// Date components formatter for banner view.
19+
public let dateComponentsFormatter = DateComponentsFormatter()
20+
21+
/// Distance formatter for banner view.
22+
public let distanceFormatter = DistanceFormatter()
23+
1924
var verticalCompactConstraints = [NSLayoutConstraint]()
2025
var verticalRegularConstraints = [NSLayoutConstraint]()
2126

Sources/MapboxNavigation/InstructionsBannerView.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ open class BaseInstructionsBannerView: UIControl {
109109
var centerYConstraints = [NSLayoutConstraint]()
110110
var baselineConstraints = [NSLayoutConstraint]()
111111

112-
let distanceFormatter = DistanceFormatter()
113-
112+
/// Distance formatter for banner view.
113+
public let distanceFormatter = DistanceFormatter()
114+
114115
/**
115116
The remaining distance of current step in meters.
116117
*/

Sources/MapboxNavigation/TopBannerViewController.swift

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ open class TopBannerViewController: UIViewController {
1313

1414
// MARK: Displaying Instructions
1515

16-
weak var delegate: TopBannerViewControllerDelegate? = nil
17-
16+
/// The delegate for the view controller.
17+
/// - seealso: TopBannerViewControllerDelegate
18+
public weak var delegate: TopBannerViewControllerDelegate? = nil
19+
1820
lazy var topPaddingView: TopBannerView = .forAutoLayout()
1921

2022
var routeProgress: RouteProgress?
@@ -25,7 +27,8 @@ open class TopBannerViewController: UIViewController {
2527

2628
lazy var informationStackView = UIStackView(orientation: .vertical, autoLayout: true)
2729

28-
lazy var instructionsBannerView: InstructionsBannerView = {
30+
/// A banner view that contains the current step instructions and responds to tap and swipe gestures.
31+
public lazy var instructionsBannerView: InstructionsBannerView = {
2932
let banner: InstructionsBannerView = .forAutoLayout()
3033
banner.heightAnchor.constraint(equalToConstant: instructionsBannerHeight).isActive = true
3134
banner.delegate = self

0 commit comments

Comments
 (0)