Coder Social home page Coder Social logo

Comments (6)

natalia-osa avatar natalia-osa commented on June 18, 2024

Sure ^^ Will add this feature in next version (this or next weekend).

from nocircleselector.

BoilingLime avatar BoilingLime commented on June 18, 2024

Thanks, great work any way, this is awesome. And one more thing. Is there a simple way to move programatically a dot ? I'm actually using it as a slider at the same time as a progress bar for audio duration. So I would like to move dot while the audio is playing in an updating methods.
I'm trying to directly set the NOCircleDot angle property, but does't seem to refresh the UI.

from nocircleselector.

natalia-osa avatar natalia-osa commented on June 18, 2024

Thank you so much^^. To move a dot via code you need to find the correct dot and setAngle:. You can calculate the angle with method: angleForValue:maxAngle:maxValue:minAngle:minValue:. Then you need to redraw NOCircleSelector.

Still, such use of the method is not animated ;). If you want animations I can add them too, that's a good idea. Will also add it in next version.

from nocircleselector.

BoilingLime avatar BoilingLime commented on June 18, 2024

This is what I'm doing, for the first part.

    NOCircleDot *dot = ((NOCircleDot *)[[circleSelector dots] objectAtIndex:1]);

    dot.angle =
    [NOCircleDot angleForValue:audioPlayer.progress maxAngle:dot.maxAngle
                      maxValue:audioPlayer.duration minAngle:kbigMinAngle minValue:0.0];
    [dot.textLabel setText:[NSString stringWithFormat:@"%@", [Utils convertSecond:
                                                              [NOCircleDot valueForAngle:dot.angle maxAngle:kbigMaxAngle maxValue:audioPlayer.duration minAngle:kbigMinAngle minValue:0.f]]]];

But I'm not sure how to redraw the NOCircleSelector properly, since there is not public methods to do it.

from nocircleselector.

natalia-osa avatar natalia-osa commented on June 18, 2024

Very well, then you only need to call this after your code:

[cicleSelector setNeedsDisplay];

This will call delegate method circleSelector:updatedDot:, so if you have your text handler there it will change the text and you can delete it here.

from nocircleselector.

BoilingLime avatar BoilingLime commented on June 18, 2024

Oh my bad I was calling setNeedsDisplay on NOCircleDot -_- !
Great it works, as you said, the animation would be a nice enhancement. I'll wait for it :).
Thanks for your help, and for your work.

from nocircleselector.

Related Issues (3)

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.