mapbox / mapbox/mapbox-navigation-ios
Reorganize CoreConstants.swift to not extend specific classes
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
I posted a notification in NavigationService and added a userInfoKey to CoreConstants, but I couldn't use NavigationService as a namespace by extending it with a NotificationUserInfoKey struct. I got a compiler error: `Type 'NavigationService.NotificationUserInfoKey' does not conform to protocol 'RawRepresentable'`. Instead, I had to use MapboxNavigationService.
Reorganizing CoreConstants.swift to have a single NotificationUserInfoKey struct at the top level instead of extending specific classes will prevent this issue from arising in the future.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in CoreConstants.swift and inspect the existing NotificationUserInfoKey definition and its extensions on NavigationService and MapboxNavigationService. Trace references to the key and notification userInfo, then reorganize the constant so those references compile without class-specific extensions. Done means the project builds and the existing notification usage remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100