mapbox / mapbox/mapbox-navigation-ios

CarPlayManager alternative Init constructor should be public

Open Beginner friendly
#4,824 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
918
Forks
326
Avg merge
1h 16m
Merged PRs (30d)
3

Description

The CarPlayManager has 2 constructors, one public, one internal.

The internal one, has the parameter of sending a "carPlayNavigationViewControllerClass" to be able to customize the CarPlayNavigationViewController (which is already open, and has the .viewDidAppear() also open).
Why would you leave the class open and having that parameter and that constructor internal?

Following should be public: ?
```
@MainActor
init(
navigationProvider: MapboxNavigationProvider,
styles: [Style]? = nil,
carPlayNavigationViewControllerClass: CarPlayNavigationViewController.Type? = nil
) {
self.navigationProvider = navigationProvider
self.core = navigationProvider.mapboxNavigation
self.eventsManager = navigationProvider.mapboxNavigation.eventsManager()
self.styles = styles ?? [StandardDayStyle(), StandardNightStyle()]
self.mapTemplateProvider = MapTemplateProvider()
self
.carPlayNavigationViewControllerType = carPlayNavigationViewControllerClass ??
CarPlayNavigationViewController.self

super.init()

mapTemplateProvider.delegate = self
}
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at CarPlayManager and compare its two constructors, especially the internal initializer shown in the issue. Verify how the carPlayNavigationViewControllerClass customization is exposed and confirm the resulting public API can be used by callers outside the module. Done means the requested initializer is publicly accessible without removing the existing customization behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.