Coder Social home page Coder Social logo

daprice / ios-tactile-slider Goto Github PK

View Code? Open in Web Editor NEW
270.0 6.0 37.0 4.42 MB

UIControl slider that can be dragged from any point within its bounds, similar to those in Control Center and Home.app

License: MIT License

Ruby 3.61% Swift 96.39%
swift ios slider uikit uicontrol uicontrol-subclass swift-package ibdesignable uikit-components

ios-tactile-slider's People

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

ios-tactile-slider's Issues

can we add image or view on slider

I tried to add image then it goes down from slider
internal func setupLayers() {
trackLayer.addSublayer(thumbLayer)
trackLayer.addSublayer(outlineLayer)
let uiview1 = UIView()
let uiview2 = UIView()
uiview1.frame = CGRect(x: 5, y: 0, width: thumbLayer.frame.width - 10 , height: 98)
uiview2.frame = CGRect(x: 5, y: 0, width: 44 , height: 44)
let appLightGrayColor = UIColor(red: 201.0/255.0, green: 201.0/255.0, blue: 201.0/255.0, alpha: 1.0)
uiview1.backgroundColor = appLightGrayColor
uiview1.layer.cornerRadius = 10
// uiview1.addSubview(uiview2)
// uiview2.center = uiview1.center
// uiview2.frame = uiview1.frame
uiview2.center = uiview1.center
uiview2.layer.contents = UIImage(named: "power-signal-white")?.cgImage
uiview2.layer.contentsGravity = CALayerContentsGravity.resizeAspect
// uiview1.center = uiview1.center
// uiview1.addSubview(uiview2)
uiview1.layer.addSublayer(uiview2.layer)
thumbLayer.addSublayer(uiview1.layer)

thumbLayer.addSublayer(thumbOutlineLayer)
    
}

sendActions not called if isContinuous = false

I think there is the following problem:

If the slider is set to isContinuous = false and the user drags to the maximum or minimum, sendActions(for: .valueChanged) is not fired.

Reason is, in didPan(sender: UIPanGestureRecognizer), you stop handing the pan if value == minimum && valueChange < 0 or value == maximum && valueChange > 0.

Action should still be sent once even for minimum or maximum value.
Otherwise it is impossible to detect if slider is set to minimum/maximum.

cornerRadius is private

Hi thanks for this library, but you may want to open the cornerRadius properties on the next update. Thank you

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.