Skip to content

Slider controller but in a circle. Just a subclass of UIView, it lets you set properties and then it works.

Notifications You must be signed in to change notification settings

nichrago/CircleSlider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

CircleSlider

I needed a slide controller in the shape of a circle in a project I was building. Thought perhaps it could be reused so I generalized it a bit. The class is still messy and much can be improved but that's part of why it's here.

Demo Video :
Circle Slider Demo

Example implementation:

var circleSlider = CircleSlider()
// set custom properties. All will default if not set
circleSlider.circle_diameter = 120.0 
circleSlider.circle_width = 10.0
circleSlider.touch_diameter = 15.0 
circleSlider.touch_tolerance = 10.0 

circleSlider.circle_color = UIColor.grayColor()
circleSlider.touch_color = UIColor.darkGrayColor()
circleSlider.trail_color = UIColor.whiteColor()

// set custom selectors... actions = .touchMoved(radian:CGFloat), .touchFailed, .circleCompleted
circleSlider.setSelector(action: .circleCompleted, target: self, selector: #selector(someFunction))

// other things in the class
// view with the dimensions of the inside of the circle
let innerCircleView = circleSlider.innerView
// if true then the circle will dissappear on completion
circleSlider.dissappear_on_completion = true

// setup the circle and draw it
circleSlider.makeSlider()

About

Slider controller but in a circle. Just a subclass of UIView, it lets you set properties and then it works.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages