Skip to content

Commit

Permalink
Add a comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredsinclair committed Jan 2, 2020
1 parent ea31ad0 commit 4629571
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/OrientationObserver/OrientationObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ public final class OrientationObserver: Publisher {
/// Used for comfort fudge.
private var previousValue: UIInterfaceOrientation = .portrait

/// @JARED
/// Accumulates a buffer of x-axis acceleration samples (measured in G's).
/// Orientation updates are suppressed whenever there is sufficient noise in
/// the buffer, as measured by a blunt but effective count of the number of
/// samples in the buffer that are outside of a predetermined magnitude.
/// This is a more effective means of suppressing too-frequent updates than
/// a Combine debounce. It's also more accurate relative to the task.
private var accelerationBuffer = CircularBuffer<Double>(capacity: Constants.accelerationBufferSize)

// MARK: - Init / Deinit
Expand Down

0 comments on commit 4629571

Please sign in to comment.