mapbox / mapbox/mapbox-navigation-ios
Migrate image tinting to UIGraphicsImageRenderer
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
#2873 introduced a `UIImage.tint(_:)` method that uses the dated `UIGraphicsBeginImageContextWithOptions(_:_:_:)`, `UIGraphicsGetImageFromCurrentImageContext()`, and `UIGraphicsEndImageContext()` functions. We should migrate this method to the more readable and less error-prone UIGraphicsImageRenderer API.
https://github.com/mapbox/mapbox-navigation-ios/blob/111551d3a31740505d20da45b0f897fd979def38/Sources/MapboxNavigation/UIImage.swift#L82-L97
/ref https://github.com/mapbox/mapbox-navigation-ios/pull/2928#discussion_r657789060
/cc @S2Ler
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 with Sources/MapboxNavigation/UIImage.swift at lines 82–97, where UIImage.tint(_:) uses the older graphics-context functions. Read the linked discussion for the intended migration and compare UIGraphicsImageRenderer usage in the surrounding project. Done means the method uses the renderer API while preserving its existing tinting behavior.
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
- 45/100