Latest1.1.0
Homepagehttps://github.com/HarshilShah/ActivityRings
LicenseMIT
Platformsios 8.0, osx 10.10, tvos 9.0
FrameworksSpriteKit
Authors

Version
Package Managers
Platforms
License
Contact

ActivityRings is an attempt to recreate the ring controls in Apple’s Activity app.

This project is a SpriteKit port of Max Konovalov’s pure UIKit implementation, MKRingProgressView.

Demo

Requirements

  • Swift 4
  • iOS 8.0+ / macOS 10.10+ / tvOS 9.0+

Installation

ActivityRings is available via CocoaPods and Carthage.

CocoaPods

To install ActivityRings using CocoaPods, add the following line to your Podfile:

pod 'ActivityRings'

Carthage

To install ActivityRings using Carthage, add the following line to your Cartfile:

github "HarshilShah/ActivityRings"

Usage

Basics

To get started, import ActivityRings, and use the ActivityRingView class within it to display the control.

Customisation

The ringWidth, the startColor, the endColor, and the backgroundRingColor can all be customised.

Progress

The progress of the ring can be set with or without animation.

To set the progress without animation, simply update the value of the progress variable.

To animate the progress, use the animateProgress method, which accepts two arguments:

  • The desired final progress value
  • The animation duration

Notes

Some notes on performance:

  • Since this control was written in SpriteKit, it relies heavily on the GPU, and so will not perform well or accurately in the simulator.
  • The initial setup process is somewhat expensive, so animating the progress directly after presenting the view can cause some hiccups. This is being worked on, but in the meantime, delaying the animation by a second or so works around the issue.

Apps Using ActivityRings

Feel free to submit a PR if you’re using this library in your apps.

Author

Written by Harshil Shah. You can find me on Twitter.

The original UIKit implementation was written by Max Konovalov.

License

ActivityRings is available under the MIT license. See the LICENSE.md file for more info.

Latest podspec

{
    "name": "ActivityRings",
    "version": "1.1.0",
    "summary": "An attempt to recreate the ring controls in Appleu2019s Activity app",
    "description": "ActivityRings is an attempt to recreate the ring controls used in Appleu2019s iOS and watchOS Activity app",
    "homepage": "https://github.com/HarshilShah/ActivityRings",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": {
        "Harshil Shah": "[email protected]"
    },
    "social_media_url": "https://twitter.com/HarshilShah1910",
    "source": {
        "git": "https://github.com/HarshilShah/ActivityRings.git",
        "tag": "1.1.0"
    },
    "frameworks": "SpriteKit",
    "source_files": [
        "Sources/Shared/**/*.swift",
        "Sources/Supporting\ Files/ActivityRings.h"
    ],
    "ios": {
        "source_files": "Sources/iOS/**/*.swift"
    },
    "osx": {
        "source_files": "Sources/macOS/**/*.swift"
    },
    "tvos": {
        "source_files": "Sources/iOS/**/*.swift"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "tvos": "9.0"
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This