Automattic / Automattic/AutomatticAbout-Swift

Provide a way to use an existing CMMotionManager

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Swift
Stars
8
Forks
4
PR merge metrics
No merged PRs in 30d

Description

## Issue

According to[ Apple's docs](https://developer.apple.com/documentation/coremotion/cmmotionmanager) for `CMMotionManager`, only a single object should exist for the app:

> **Important**
>
> Create only one [CMMotionManager](https://developer.apple.com/documentation/coremotion/cmmotionmanager) object for your app. Multiple instances of this class can affect the rate at which data is received from the accelerometer and gyroscope.

If an app already uses `CMMotionManager` and imports this library, it could potentially cause side effects with the one in [`AppLogosScene`](https://github.com/Automattic/AutomatticAbout-Swift/blob/0f784591b324e5d3ddc5771808ef8eca923e3de2/Sources/AutomatticAbout/AutomatticAppLogosCell.swift#L113). Perhaps an existing `CMMotionManager` could be supplied to this library.

## Context

We use gyro data for the Jetpack app landing screen which requires a [`CMMotionManager` object](https://github.com/wordpress-mobile/WordPress-iOS/blob/72e204de112edc91cdbe2a87809c2a3bf572e414/WordPress/Jetpack/Classes/NUX/JetpackPrologueViewController.swift#L20).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in Sources/AutomatticAbout/AutomatticAppLogosCell.swift at the AppLogosScene CMMotionManager usage, then compare it with the JetpackPrologueViewController example linked in the issue. Define how an existing CMMotionManager can be supplied without changing current behavior, and confirm that the library uses the supplied manager rather than creating a second instance.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.