Giter Club home page Giter Club logo

uicircularprogressring's Introduction

UICircularProgressRing

UICircularProgress ring is a library for rendering circular progress rings and timers.

  • Declarative: Written using SwiftUI (legacy UIKit version available), UICircularProgressRing is declarative making it easy to read, and easy to use.
  • Customizable: Designed to be used in production, all of the views are highly customizable without giving up ease of use. This allows the developer to tailor the look, feel and functionality to fit their needs.
  • Tested: Battle tested in many production applications. UICircularProgressRing is also fully unit tested as well as snapshot tested so developers can feel safe.
  • Documented: UICircularProgressRing's public API is 100% documented and its something that is enforced before any code is ever added. This is a resource that will help any new user understand how to get the most out of this library.

iOS 14+ Note

Since Apple has now added a built in ProgressView the need for this library is about to be over. My recommendation: If you can support iOS 14.0 and use the new system ProgressView then you should use that. This library will be continued to be maintained (critical bugs will be fixed, etc) but no new features are planned as we are reaching EOL for this library.

Installation

UICircularProgressRing is available in two major versions. The latest version v7.0+ or legacy versions. The legacy version is written using UIKit and requires a deployment target of iOS 8.0+ or tvOS 10.0+. The latest version is written in SwiftUI and requires iOS 13.0+, macOS 15.0+, tvOS 13.0+ or WatchOS 2.0+.

For legacy installation, follow these instructions.

Swift Package Manager

Simply add this library to your package manifest or follow instructions on adding a package dependency using Xcode here.

.package(
    url: "https://github.com/luispadron/UICircularProgressRing.git",
    .branch("master")
)

Documentation

This projects public API is 100% documented and it's something we spend a lot of time working on. Please make sure to read the documentation before opening any issues, questions, etc.

Read the documentation ๐Ÿ“–

Usage

ProgressRing

ProgressRing is a view designed to display some kind of progress, this can be anything which is represented as a percentage in the range [0, โˆž). A percentage is represented in decimal format, i.e. 0.5 is 50%. Progress may be a downloading operation, the grade percentage of a users test score, etc. A short example of using ProgressRing is shown below, for more details read the docs or play with the example app.

struct ProgressRingExample: View {
    @State var progress = RingProgress.percent(0.44)

    var body: some View {
        VStack {
            ProgressRing(
                progress: $progress,
                axis: .top,
                clockwise: true,
                outerRingStyle: .init(
                    color: .color(.gray),
                    strokeStyle: .init(lineWidth: 20)
                ),
                innerRingStyle: .init(
                    color: .color(.green),
                    strokeStyle: .init(lineWidth: 10),
                    padding: 5
                )
            )
                .animation(.easeInOut(duration: 5))
                .padding(32)
        }
    }
}

An example image of a ProgressRing view rendered with a green inner circle, a gray outer circle and at 44 percent completion.

TimerRing

TimerRing is a view designed to display time. You initialize the timer by giving it a unit of time and duration, for example: .seconds(60). This means the TimerRing will run for 60 seconds, filling up the inner ring until finally reaching 100% around the entire outer ring. A short example of using TimerRing is shown below, for more details read the docs or play with the example app.

struct TimerRingExample: View {
    @State var isPaused = false
    @State var isDone = false

    var body: some View {
        TimerRing(
            time: .minutes(1),
            delay: .seconds(0.5),
            innerRingStyle: .init(
                color: .color(.green),
                strokeStyle: .init(lineWidth: 16),
                padding: 8
            ),
            isPaused: $isTimerPaused,
            isDone: $isTimerDone
        ) { currentTime in
            Text(timeFormatter.string(from: currentTime))
                .font(.title)
                .bold()
        }
    }
}

A demo image of a timer ring view with a green inner ring, a gray outer ring and at twenty-seven seconds.

Examples

Apps Using UICircularProgressRing

uicircularprogressring's People

Contributors

abeltoy-coditramuntana avatar bobgilmore avatar byronsalty avatar carls376 avatar chris-redbeed avatar darecki avatar dependabot[bot] avatar eladhayun avatar gutenbergn avatar jinjorge avatar luispadron avatar nickdnk avatar nikolaisa avatar petewalker avatar ptescher avatar rxdx avatar swifttsubame avatar tomerciucran avatar vitl-makan avatar wassup- avatar wvteijlingen avatar yene avatar younatics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uicircularprogressring's Issues

Animate doesn't work

I have the following setup. But the animation is not working it just appears on the screen. Any clue on what I am doing wrong?

let profileProgressView: UICircularProgressRingView = {
   
    let view = UICircularProgressRingView(frame: CGRect(x: 0, y: 0, width: 124, height: 124))
    view.maxValue = 100
    view.outerRingColor = UIColor.white
    view.innerRingColor = UIColor.white
    view.viewStyle = 2
    view.startAngle = 90
    view.outerRingCapStyle = 2
    view.outerRingWidth = 8
    view.shouldShowValueText = false
    view.translatesAutoresizingMaskIntoConstraints = false
    return view
    
}()

func setConstraints() {
    profileProgressView.topAnchor.constraint(equalTo: profileBackgroundView.topAnchor, constant: 8).isActive = true
    profileProgressView.centerXAnchor.constraint(equalTo: profileBackgroundView.centerXAnchor).isActive = true
    profileProgressView.widthAnchor.constraint(equalToConstant: 124).isActive = true
    profileProgressView.heightAnchor.constraint(equalToConstant: 124).isActive = true
}

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    
    delay(2.5, completion: {
        self.profileProgressView.setProgress(value: 60, animationDuration: 5, completion: nil)
    })
}

func delay(_ seconds: Double, completion:@escaping ()->()) {
    let popTime = DispatchTime.now() + Double(Int64( Double(NSEC_PER_SEC) * seconds )) / Double(NSEC_PER_SEC)
    
    DispatchQueue.main.asyncAfter(deadline: popTime) {
        completion()
    }
}

Inside collection view issue

I have the control inside my custom UICollectionViewCell, loaded from a XIB. When I set the progress it doesn't animate, just set the color to that value without animation, but after the animation time the completion callback is called. The setProgress is called inside the cellForItemAt callback of the UICollectionView.

Tried to set the value in different ways and also call setNeedsDisplay before and after the setProgress. None of this works.

I'm missing something in order to make this work properly?

Can I change value of "valueLabel"?

Hi,
Thanks for this library. In my project, I have to set different value to valueLabel, in example "45+".
But because of private, it can't be done.

lazy private var valueLabel: UILabel = UILabel(frame: CGRect(x: 0, y: 0, width: 0, height: 0))

Could you add this improvement please.

Thank you.

How can i Pause this animation for some time can you explain me

READ BEFORE POSTING AN ISSUE

Not following these guidelines may result in me ignoring or closing your issue, please carefully read and submit an appropriate issue as it helps with time and fixes.

Please provide the current version of the library you are using

  • Version =

Have you read the documentation?

  • Yes

  • No

    If no, read the docs here before posting an issue

Is it a bug? Provide the following

  • Detailed overview of what you are trying to accomplish
  • What is the expected outcome?
  • What is the actualy outcome?
  • Either post sample code, or example project where isssue can be recreated

Is it a question? Provide the following

  • Has it be answered here before?
  • Be detailed and describe the question in detail
  • If it's a question about something that is happening within your code base, either post a small amount of code, email me project if you want to keep it private, or post an example project where I can try to assist
  • Please do your own research before posting any questions which may have been asked on StackOverFlow before.
  • Make sure to communicate back and keep issue updated or it will be closed

Is it a feature request? Provide the following

  • Does it make sense to put this in the project? Why
  • Is it something that can be done in a reasonable amount of time?
  • Will it effect anyone currently using the lib?
  • Have you tried to implement this and submit a pull request, if no, why not?

If you have read all of this please follow the template and post the issue. Thanks for using UICiruclarProgressRing.

.setProgress() animationDuration not accurate

Hi!

Great work!
I am working with version 1.6.2 and I read the documentation.

I am using setProgress with an animationDuration.
When I set it to 30 seconds, the actual timespan it needs to finish is too small. It finishes about 5 seconds too early. I timed it on a real device (iPhone 5S) and on the emulator. Same result.

Thank you!

Is there a way to restart the animation?

I have a button and when it is pressed stuff on screen happens and the progress ring starts. The idea is that when the progress ring is animating the user can't press the button. I originally had this code:

func animateCircularProgressView(delayTime: Int) {
        
    button.isUserInteractionEnabled = false
        
    progressRing.setProgress(value: 100, animationDuration: TimeInterval(delayTime)) {
        self.progressRing.setProgress(value: 0, animationDuration: 0, completion: nil)
        self.button.isUserInteractionEnabled = true
    }
        
}

which works to stop the user pressing the button whilst the timer is on but what I would rather is for when the button is clicked to reset the animation. I have this:

var timerIsOn: Bool = false

@IBAction func btnTapped(_ sender: AnyObject) {
    if timerIsOn {
        //playErrorSound()
        animateCircularProgressView(delayTime: time)
    } else {
         // do button stuff
    }
}

    
func animateCircularProgressView(delayTime: Int) {
        
    timerIsOn = true
        
    progressRing.setProgress(value: 100, animationDuration: TimeInterval(delayTime*2)) {
        self.progressRing.setProgress(value: 0, animationDuration: 0, completion: nil)
        self.timerIsOn = false
    }
        
}

But this just makes the timer disappear. Is there an easy way to just reset it whenever the button is pressed whilst it is animating?

UIProgressRing stops if app resigns to background and then returns?

Hi, i'm just making a simple timer for my fitness app with your api. And it works really well, but i've included functionality in my timer for when the app goes into the background and the user returns the timer continues but there's no animation for the progress ring. Just wondering what i'm doing wrong. Here's the code:

class TimerViewController: UIViewController, UICircularProgressRingDelegate {

@IBOutlet weak var timerView: UICircularProgressRingView!
@IBOutlet weak var timerLabel: UILabel!
@IBOutlet weak var timerTextField: UITextField!

    let center = UNUserNotificationCenter.current()
    let notificationCenter = NotificationCenter.default

   var backgroundDate: Date?
   var totalTime: Double = 5.0
   var timer = Timer()

 override func viewDidLoad() {
        super.viewDidLoad()
        notificationCenter.addObserver(self, selector: #selector(appMovedToBackground), name: Notification.Name.UIApplicationDidEnterBackground, object: nil)
    }
    
    func appMovedToBackground() {
        
        if totalTime > 1 {
        
        timer.invalidate()
        
        let content = UNMutableNotificationContent()
        content.title = "Rest Period Finished!"
        content.body = "Get ready for your next set"
        content.sound = UNNotificationSound.default()
        
        let trigger = UNTimeIntervalNotificationTrigger.init(
            timeInterval: TimeInterval(totalTime),
            repeats: false)
        
        let request = UNNotificationRequest(identifier: "restPeriod", content: content, trigger: trigger)
        center.add(request)
        
        backgroundDate = Date.init()
        
        notificationCenter.addObserver(self, selector: #selector(appReturnedFromBackground), name: Notification.Name.UIApplicationWillEnterForeground, object: nil)
        }
    }
    
    func appReturnedFromBackground() {
        if backgroundDate != nil {
        let returnDate = Date.init()
        
        let difference = returnDate.timeIntervalSince(backgroundDate!)
        
        if Double(difference) > totalTime {
            timer.invalidate()
            timerView.setProgress(value: 0, animationDuration: 0)
            timerLabel.text = "00"
            totalTime = 1
            start.isEnabled = true
            
            _ = self.navigationController?.popViewController(animated: true)
        } else {
            timer.invalidate()
            
            center.removePendingNotificationRequests(withIdentifiers: ["restPeriod"])
            
            let totalTimeLeft = totalTime - Double(difference)
            totalTime = totalTimeLeft
            
            timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(TimerViewController.counter), userInfo: nil, repeats: true)
            
            timerView.animationStyle = kCAMediaTimingFunctionLinear
            
            timerView.setProgress(value: 270, animationDuration: Double(totalTime)) {
                self.timerView.setProgress(value: 0, animationDuration: 0)
            }
            
            timerLabel.text = String(totalTime)
        }
            
        }
    }

    @IBAction func startButton(_ sender: Any) {
        
        timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(TimerViewController.counter), userInfo: nil, repeats: true)
        
        timerView.animationStyle = kCAMediaTimingFunctionLinear
        
        timerView.setProgress(value: 270, animationDuration: Double(minutes + seconds)) {
        }
        
        totalTime = Double(textField.text!)
        timerLabel.text = String(totalTime)
        }
    
    
    @IBAction func stopButton(_ sender: Any) {
        timerLabel.text = "00"
        timer.invalidate()
        totalTime = 0
    }
    
    func finishedUpdatingProgress(forRing ring: UICircularProgressRingView) {
        timerView.setProgress(value: 0, animationDuration: 0)
    }
    
    deinit {
        center.removePendingNotificationRequests(withIdentifiers: ["restPeriod"])
        notificationCenter.removeObserver(self, name: Notification.Name.UIApplicationDidEnterBackground, object: nil)
        notificationCenter.removeObserver(self, name: Notification.Name.UIApplicationWillEnterForeground, object: nil)
        print("Class destroyed")
    }
}

Thanks

How to implement as a timer?

I want to implement a timer component into my app. I'm just confused on how to go about doing it with this library.

Support Setting Minimum Value

How to set minimum value to show custom range value?

I want to show range between 250 - 500,
How can I show that?

Thank you,

How get current ring value?

My view contains a button, after buttonTap I want to speed up the ring starting now like as

ring.setProgress(value: ring.currentValue, animationDuration: 5 , completion: nil)

want it to animate per second. How it can be done?

Function animate with duration is not working on second basis. It animates so quickly. Want it to animate per second. Want to implement it in quiz app as a countdown timer.
Please help.
And i know, Github is not for doubts. But, don't have any other option. It's damn urgent. Sorry. Please help.

How To Specify Version In CocoaPods?

How would I pull a different version (Version 1.5.5) from cocoapods I want to know because 8.3.3 xcode doesn't support swift 4 and thats the version where swift 3 is still supported

Applications Using UICircularProgressRing

Do you use this library?

Hey everyone, thanks for using this library and helping me build it!

If you're using the library in a readily available application and would like to show it off,
post a comment with a link to your application!

I'll feature a compilation on the homepage of the library once a list is curated.

Ring Value Based On Time

How can I have it start with say 30 seconds and instead of a % its a countdown until its done

Pod requires target of iOS 10.0

I cannot use this on a new app I am building because our client wants our app to work with both iOS9 and iOS10. Is iOS 10, necessary for this pod? I see that in your pod spec.

When I run pod install with:
platform :ios, '9.0'

I get an error about UICircularProgressRingrequired a higher minimum deployment target.

If i run this with
platform :ios, '10.0'

I can install properly

Restart progress available?

Is it possible to restart the progress? First time, it works fine. But i want restart progress by clicking button.
I've called setProgress func again but it doesnt work.
I appreciate any help

'Track' Colour

In your example image, how did you achieve the 'bordered' effect in the '83%' example?

I'm setting the outer and inner ring colours, but I'm unable to set the 'track' colour to be of a different colour.

Thanks!

Need help with property currentValue

  • Version = 1.6.1

Have you read the documentation?

  • Yes
  • No

Is it a bug?

I am not sure that it's bug

Is it a question? Provide the following

In my app, I am using UICircularProcessing. It is working really good and easy to understand. Good job!
However, I need to do something with property currentValue but it is not working. Maybe, I am not using it correctly. I have read all your doc and code, but still need your help.

In my app, I have a label that I want to update each time the UICircularProcessing made a progress. So as I read in your doc, property currentValue can give this information in realtime. But I didn't succeed with it. Below I share with you a small code on how I am trying to do that, I am certainly not using it in the correct way :-)

`

    circularProgressView.setProgress(value: 535, animationDuration: 10)
    DispatchQueue.global(qos: .background).async {
        while self.circularProgressView.isAnimating {
            print(self.circularProgressView.currentValue!)
        }
    }

`

So if I understand well, during animation I should get the progression of the currentValue in realtime. But the print gives me always the same value, until animation stops.

Thanks in advance for your help.

Unit text

I'd like to be able to put a unit for the text inside the circular progress view like "GB" as you have it on the main page. How can I achieve this?

Inside CollectionView

I have a weird issue. I have the control inside my custom UICollectionViewCell, loaded from a XIB. When I set the progress it doesn't animate, just set the color to that value without animation, but after the animation time the completion callback is called.

Tried to set the value in different ways and also call setNeedsDisplay before and after the setProgress.

Breaking change in point release

The new version of setProgress(value:animationDuration:completion:) specifies that the completion block defaults to nil which would not break anything, but it doesn't actually have a default value which means you have to add completion: nil anywhere you call setProgress.

Wrong Progress bar value shown

  • I used start angel as -90 & my value range is 0-100.

When i try to set progress value as 50 then Circle is not half but more than half as shown below.

screen shot 2017-03-24 at 3 15 24 pm

but if I set start angel as default then it works fine.

endAngle is ignored after updated to 1.4.2

Please provide the current version of the library you are using

  • Version = 1.4.2

Have you read the documentation?

  • Yes
  • No

Bug

I was using the library with startAngle = 45 and endAngle = 270 to have a progress view in the non-complete fraction of a circle.
After updating to 1.4.2, my circles are now complete instead of a 62.5% fraction of a circle.
The startAngle seems to still be functioning, but whatever the value of my endAngle, The circle remains complete.

UICircularProgressRing.innerRingColor not updating

READ BEFORE POSTING AN ISSUE

Not following these guidelines may result in me ignoring or closing your issue, please carefully read and submit an appropriate issue as it helps with time and fixes.

Please provide the current version of the library you are using

  • Version = 1.4.2

Have you read the documentation?

  • Yes

Is it a bug? Provide the following

  • Detailed overview of what you are trying to accomplish

Hello, i have implemented UICircularProgressRing in my project. actually im getting percentage value from webservice and i'm setting it to theUICircularProgressRing and it is working fine with animation with proper color for both inner and outer ring. But after loading and setting the percentage successfully i need to change the theme color for my views and also for UICircularProgressRing. but the color is not setting for the UICircularProgressRing.innerRingColor
but when my viewdidLoad method is called then the new color is setting for the inner ring properly.

Please Help.
ThankYou.

the style of the progress ring cannot show as I want

As I read the document,I set the value of viewStyle equal 2, but the radius of inner ring is smaller than outer ring, rather than equal to its.here is the result and code:
image

       ring1.animationStyle = kCAMediaTimingFunctionLinear
        ring1.fontSize = 20
        ring1.fontColor = UIColor.yellow
        ring1.maxValue = 10
        ring1.viewStyle = 2
        ring1.innerRingColor = UIColor.yellow
        ring1.setProgress(value: 9, animationDuration: 5, completion: nil)

here is I want it to be that:
image
Should I set the inner circle width to equal the outer circle width?? I tried that ring1.innerRingWidth = ring1.outerRingWidth, it can not achievement my thinking, Hope you can help me, thanks!

Need to show fractional value on progress label (question or feature)

I need fractional value in progress label. It is showing only whole number. How to show value like this:
0.1% 0.2% ... 99.9% of a progress value in a label.

I need this because I am showing circular progress ring for large file download. In poor networks, it takes more time to progress from 1% to 2%. If I can show fractions, it looks effective.

Thanks!

Stopping current animation and adding another one?

Hello Luis,

I am developing a speedtest app and using the framework for showing countdown for a download period. By default it is planned to be animating 10 seconds like:
self.uploadCircle.setProgress(value: 100, animationDuration: 10.0)
but sometimes download finishes earlier than 10 seconds. In those cases i want to stop the 10 second animation and immediately make it %100 percent. I tried several ways like:

func downloadTimerInvalidator () {

    if let downReq = self.downloadRequest{
        downReq.cancel()
    }
    DispatchQueue.main.async {
        self.downloadCircle.setProgress(value: 100, animationDuration: 0.1)
    }
}

but it didn't work. It is like ignoring this line and having the full 10 sec cycle. Any help is appreciated. Thanks.

Unusual start of percentage ring

Most of the percentage circular rings I have seen start from vertical top, but this one doesn't. See the following pictures, for example. What is your say about it?

circliful
ck5lv
images
images
stock-vector--percent-blue-circle-charts-568304968

pod install error

i run pod install but :
Unable to find a specification for UICircularProgressRing
thank you!

how to add class and module at UIView programmatically

Hi,

Can you guide me how to add class and module at UIView programmatically , I search for alot on internet but none solution work for me .

I tried to type in "UICircularProgressRingView" , but xcode doesn't recognize. I new with swift sorry

Reanimating Progress Ring

How would you handle re-animating the progress ring upon returning to the view controller?

Imagine a scenario where I start a download on a view controller it starts animating the progress ring and I leave said view controller and return later to see the progress ring update based on progress info.

Right now I am tracking the download progress globally and upon revisiting the view controller the progress ring updates but stops while the progress info keeps updating. Any thoughts?

Thanks!

Custom font not working

Hello! Thank you for this amazing library. I have set this in the IB: "Montserrat-Semibold".
The font is surely imported correctly into the app, because IB shows this:

snip20170216_1

But, it breaks when the table view cell displays it. I get this:
snip20170216_2

I don't modify the cell at all, nor I don't change anything except the progress by calling setProgress.

Any ideas why it break? I also tried to set it programatically, exactly same result.

If i want to pause animation for some time how can i do that?

READ BEFORE POSTING AN ISSUE

Not following these guidelines may result in me ignoring or closing your issue, please carefully read and submit an appropriate issue as it helps with time and fixes.

Please provide the current version of the library you are using

  • Version =

Have you read the documentation?

  • Yes

  • No

    If no, read the docs here before posting an issue

Is it a bug? Provide the following

  • Detailed overview of what you are trying to accomplish
  • What is the expected outcome?
  • What is the actualy outcome?
  • Either post sample code, or example project where isssue can be recreated

Is it a question? Provide the following

  • Has it be answered here before?
  • Be detailed and describe the question in detail
  • If it's a question about something that is happening within your code base, either post a small amount of code, email me project if you want to keep it private, or post an example project where I can try to assist
  • Please do your own research before posting any questions which may have been asked on StackOverFlow before.
  • Make sure to communicate back and keep issue updated or it will be closed

Is it a feature request? Provide the following

  • Does it make sense to put this in the project? Why
  • Is it something that can be done in a reasonable amount of time?
  • Will it effect anyone currently using the lib?
  • Have you tried to implement this and submit a pull request, if no, why not?

If you have read all of this please follow the template and post the issue. Thanks for using UICiruclarProgressRing.

Circle is not completing properly in iOS 10.3, Xcode 8.3.2. Same code is working in iOS 8.1.

READ BEFORE POSTING AN ISSUE

Not following these guidelines may result in me ignoring or closing your issue, please carefully read and submit an appropriate issue as it helps with time and fixes.

Please provide the current version of the library you are using

  • Version =

Have you read the documentation?

  • Yes

  • No

    If no, read the docs here before posting an issue

Is it a bug? Provide the following

  • Detailed overview of what you are trying to accomplish
  • What is the expected outcome?
  • What is the actualy outcome?
  • Either post sample code, or example project where isssue can be recreated

Is it a question? Provide the following

  • Has it be answered here before?
  • Be detailed and describe the question in detail
  • If it's a question about something that is happening within your code base, either post a small amount of code, email me project if you want to keep it private, or post an example project where I can try to assist
  • Please do your own research before posting any questions which may have been asked on StackOverFlow before.
  • Make sure to communicate back and keep issue updated or it will be closed

Is it a feature request? Provide the following

  • Does it make sense to put this in the project? Why
  • Is it something that can be done in a reasonable amount of time?
  • Will it effect anyone currently using the lib?
  • Have you tried to implement this and submit a pull request, if no, why not?

If you have read all of this please follow the template and post the issue. Thanks for using UICiruclarProgressRing.

Silence 'not drawing value label' debug log

The debugging area becomes nearly unusable when shouldShowValueText = false because it is constantly printing Not drawing value label because shouldShowValueText = false.

It'd be nice to have the option to silence this in some way, in the meantime I'm having to just display the undesired label during development.

Propery 'patternForDashes' issue

Hello !

There is a slight issue on the patternForDashes, property.
When it is used, you only take into account the first member of the provided array.

In your UICircularProgressRingLayer L173 :
outerPath.setLineDash(patternForDashes, count: 1, phase: 0.0)
and it should (according to me) be :
outerPath.setLineDash(patternForDashes, count: patternForDashes.count, phase: 0.0)

Without fixing this, you can't set a proper dash pattern, only the length of a dash is taken into account.

Hope it helps.

Padding

Is there anyway to add padding to the view? I want it a specific size but then to be able to add padding to all sides so it "shrinks"

Pixelated progress bar

Hello,

Thanks for making this project! I'm having some issues with the way the progress ring is rendered. I'm embedding the progress ring into a TableViewCell and when it first loads, it shows up pixelated like this:

unclicked table cell

Strangely, after clicking it, it then renders nice and smoothly:

after clicking the table cell

This is some minimal test code for initializing the TableViewCell, using Cartography for autolayout constraints .


 override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)

        let progressRing = UICircularProgressRingView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))

        progressRing.setProgress(value: 39, animationDuration: 2.0) {
            print("Done animating!")
        }

        self.contentView.addSubview(progressRing)

        constrain(progressRing) {p in
            p.center == p.superview!.center
        }
    }

I'm not sure that it has anything specifically to do with your library since I can't seem to reproduce it from your sample app, but do you have any idea what could be causing this?

There are a bunch of stackoverflow issues that say it might have something to do with CALayer and the contentsScale property, but I don't have enough experience with CALayer to know whether that's the case.

Gradient for ring

First: Great Framework, especially the customizability!

I haven't font the ability to add a color gradient for the rings. Before I adopt your framework I would like to ask if you already have designed this.

Thanks

Asking

Can i make the progress view like this? and the label is stick beside the value knob?
screen shot 2016-10-11 at 12 13 05 pm
screen shot 2016-10-11 at 12 17 24 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.