-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa7963b
commit f964977
Showing
7 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = 'ActivityRings' | ||
spec.version = '1.0.0' | ||
spec.summary = 'An attempt to recreate the ring controls in Apple’s Activity app' | ||
spec.description = <<-DESC | ||
ActivityRings is an attempt to recreate the ring controls used in Apple’s iOS and watchOS Activity app | ||
DESC | ||
spec.homepage = 'https://github.com/HarshilShah/ActivityRings' | ||
spec.license = { type: 'MIT', file: 'LICENSE.md' } | ||
spec.author = { 'Harshil Shah' => 'harshilshah1910@me.com' } | ||
spec.social_media_url = 'https://twitter.com/HarshilShah1910' | ||
|
||
spec.source = { git: 'https://github.com/HarshilShah/ActivityRings.git', tag: spec.version.to_s } | ||
spec.ios.deployment_target = '8.0' | ||
spec.ios.source_files = 'Sources/**/*.{h,swift}' | ||
spec.ios.frameworks = 'SpriteKit' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## Changelog | ||
|
||
## 1.0.0 Release notes (18/10/2017) | ||
---- | ||
|
||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 Harshil Shah <harshilshah1910@me.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# ActivityRings | ||
|
||
[![Version](https://img.shields.io/github/release/HarshilShah/ActivityRings.svg)](https://github.com/HarshilShah/ActivityRings/releases/latest) | ||
![Package Managers](https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage-green.svg) | ||
[![License](https://img.shields.io/badge/license-MIT-yellow.svg)](https://github.com/HarshilShah/ActivityRings/blob/master/LICENSE) | ||
[![Contact](https://img.shields.io/badge/contact-%40HarshilShah1910-3a8fc1.svg)](https://twitter.com/HarshilShah1910) | ||
|
||
ActivityRings is an attempt to recreate the ring controls in Apple’s Activity app. | ||
|
||
This project is a SpriteKit port of [Max Konovalov](https://github.com/maxkonovalov)’s pure UIKit implementation, [MKRingProgressView](https://github.com/maxkonovalov/MKRingProgressView). | ||
|
||
![Demo](https://raw.githubusercontent.com/HarshilShah/ActivityRings/master/.assets/demo.gif) | ||
|
||
## Requirements | ||
|
||
- Swift 4 | ||
- iOS 8 | ||
|
||
## Installation | ||
|
||
ActivityRings is available via CocoaPods and Carthage. | ||
|
||
### CocoaPods | ||
|
||
To install ActivityRings using [CocoaPods](http://cocoapods.org), add the following line to your Podfile: | ||
``` | ||
pod 'ActivityRings' | ||
``` | ||
### Carthage | ||
|
||
To install ActivityRings using [Carthage](https://github.com/Carthage/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](https://twitter.com/HarshilShah1910). | ||
|
||
The original UIKit implementation was written by [Max Konovalov](https://github.com/maxkonovalov). | ||
|
||
## License | ||
|
||
ActivityRings is available under the MIT license. See the LICENSE.md file for more info. |