Skip to content

Use ranges when we can [RFQ] #86

@fulldecent

Description

@fulldecent

This breaks API so we need to:

  • Implement new API
  • Reimplement old API utilizing new API
  • Mark old API as deprecated

And then create a new issue:

  • Remove deprecated API
  • Bump major version

Changes

  • Change zoomSamples* to a range (this change is cosmetic)
    • Remove zoomStartSamples
    • Remove zoomEndSamples
    • Add zoomSamples: CountableClosedRange<Int>
  • Change highlightedSamples to a range (related: Using 3+ colors #42, Multiple colors of Progress Samples #43 ) (this change now allows highlighting from somewhere that does not start at zero)
    • Remove progressSamples
    • Add highlightedRange: CountableClosedRange<Int>?
    • Rename progressColor to highlightColor

Implementation notes

Ranges have a few nifty methods that we can use:

  • func clamped(to: Range<Bound>)
  • func contains(Bound)
  • func overlaps(Range<Bound>)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions