mapbox / mapbox/mapbox-maps-ios

Use CADisplayLink.targetTimestamp to drive animations

Open
#293 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged feature :green_apple:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

The new flyTo implementation uses `Date()` directly. Which is not the most sophisticated way of handling timing in animations. We should use [`CADisplayLink.targetTimestamp`](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1648422-targettimestamp) instead.

Also applies to `GestureDecelerationCameraAnimator`. See https://github.com/mapbox/mapbox-maps-ios/pull/692#discussion_r712514230

Also applies to `InterpolatedLocationProducer`

_Originally posted by @julianrex in https://github.com/mapbox/mapbox-maps-ios/pull/282#discussion_r618626797_

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

Locate the new flyTo implementation, GestureDecelerationCameraAnimator, and InterpolatedLocationProducer, then read the linked PR discussion for the timing context. Trace where each animation currently obtains time from Date(); done means all three use CADisplayLink.targetTimestamp consistently and their animation timing remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.