Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate sliders programmatically #101

Open
grifas opened this issue Jan 2, 2020 · 1 comment
Open

Animate sliders programmatically #101

grifas opened this issue Jan 2, 2020 · 1 comment

Comments

@grifas
Copy link

grifas commented Jan 2, 2020

Is there a way to animate selectedMinimum/selectedMaximum programmatically ?

I used:

UIView.animate(withDuration: 0.2) { [weak self] in
	self?.slider.selectedMaximum = value
	self?.layoutIfNeeded()
}

but no result :/

@TomThorpe
Copy link
Owner

Hey!

I’m not 100%, but I think this is possibly caused because the handles and lines within the control are mostly CALayers, not uiviews, so the uiview.animate method might not work as expected.

Do you get any better results if you use CATransaction with an animate duration? A bit like the - (void)animateHandle:(CALayer*)handle withSelection:(BOOL)selected { method within the implementation (this just animates the handles getting bigger as you select them, but its just an example of animation within the control)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants