Code Monkey home page Code Monkey logo

circleslider's People

Contributors

shushutochako avatar tarasdbbest 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

circleslider's Issues

fatal error: found nil while unwrapping an Optional value

I was using the circle slider for my app, when this happened:

private func redraw() {
    self.trackLayer.removeFromSuperlayer()
    self.trackLayer = TrackLayer(bounds: self.bounds, setting: self.createLayerSetting())
    self.thumbView.removeFromSuperview()
    self.thumbView = UIView(frame: CGRect(x: 0, y: 0, width: self.thumbWidth, height: self.thumbWidth))
    self.layout(self.latestDegree)
  }

It called a EXC Bad Instruction on the .removeFromSuperlayer(). This is part of the framework.

When I run on a physical device, I get EXC_BREAKPOINT and my view won't load.

The cause may have been when I used

circleSlider.addTarget(self, action: #selector(TodayViewController.chngVol(_:)), forControlEvents: .ValueChanged)

without specifying it as an Optional, as Xcode wouldn't let me make it an Optional.

How should I fix this?!

Problem with the thumb

Hi,

There is a little problem with the thumb.
If you set its width much larger than the bar width, you can touch it at its external bounds.
It is because it is outer the slider area.
(If you touch a control outer from its superview, it does not respond to touch)

I think you need to enlarge the slider area by 0.5 * thumb width.

Thanks !

Problems with Example Project

Hi,
I wanted to try your pod, but I had following problems. I managed to overcome them (leave my solutions for reference), but it think it could be fixed for other users:

  1. pod try CircleSlider doesn't work - I had to clone repository
  2. pod install (in Example directory) doesn't work - I changed Podfile and removed exclusive part (after name and before 'do')
  3. example didn't start due to provisioning profile problems - I changed profile to mine.
  4. example didn't build due to provisioning problems in test project - (again changed profile)

(I don't know if 3 and 4 are fixable, but let's hope so :) )

Also pod install throws some warnings and on IPhone 5C sliders overleap with progress circle (but it doesn't make it unreadable).

Thank you for this pod. I think it will really help me.

How can I set a starting value ?

Hi,
Sorry to bother again...
I would like to set a starting value to the slider. It should appeared on the beginning like that :
screenshot slider

I did not find a correct way to do that. For now, I am setting in viewWillAppear :
circleSlider.value = 30

but it briefly shows zero value before displaying value as 30.

Do you have any idea ?

Thanks a lot !

Adding a tap gesture

Hi,
it is a really beautiful widget you have done !

How can I add a tap gesture on the circle, in addition to sliding move ?

Thanks !

How do I get the current value of CircleSlider?

Usually I use sender.value to get the current value but I can't do that with this library. Only UILabel can get the current value such as the example down there? But I want to use it as float and send it to another function, what can I do?

func valueChange(sender: CircleSlider) {
switch sender.tag {
case 0:
self.valueLabel.text = "(Int(sender.value))"
case 1:
self.progressLabel.text = "(Int(sender.value))%"
default:
break
}
}

No such module 'CircleSlider' - Unable to run demo

  1. Cloned repo - no problem
  2. Ran pod install successfully - no problem
  3. Opened up the Project file and ran - Build Failed > "No Such Module 'CircleSlider'" for line 10 "import CircleSlider" in ViewController.swift
    screen shot 2016-03-12 at 10 02 34 pm

screen shot 2016-03-13 at 10 09 21 pm

strange form of a circle

If you set different values for height and width�, Circle is not drawn correctly

ex)

let rect = CGRect(x: 0, y: 0, width: 100, height: 200)
self.circleSlider =  CircleSlider(frame: rect, options: nil)

how can look Circleslider ?

hello
how can look FoodQSlider ?

   @IBOutlet weak var FoodQSlider      : UIView!

private func buildCircleSliderFoodQSlider() {
        self.circleSlider = CircleSlider(frame: self.FoodQSlider.bounds, options: self.sliderOptions)

        let delay = 0.1 * Double(NSEC_PER_SEC)
        let time  = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
        dispatch_after(time, dispatch_get_main_queue(), {
            self.circleSlider.value = Float(self.reviwesRoundTwo[0])
        })
        self.FoodQSlider.addSubview(self.circleSlider!)
        self.valueLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
        self.valueLabel.textAlignment = .Center
        self.valueLabel.center = CGPoint(x: CGRectGetWidth(self.circleSlider.bounds) * 0.5, y: CGRectGetHeight(self.circleSlider.bounds) * 0.5)
        self.valueLabel.text = String(reviwesRoundTwo[0])
        self.circleSlider.addSubview(self.valueLabel)
    }

few CircleSlider ?

hello
I am used few to slider

 @IBOutlet weak var FoodQSlider      : UIView!
    @IBOutlet weak var Cleanness        : UIView!
    @IBOutlet weak var StaffPerformance : UIView!
    @IBOutlet weak var Facilities       : UIView!
    @IBOutlet weak var InternetService  : UIView!
    @IBOutlet weak var AccToBazzar      : UIView!
    @IBOutlet weak var AccToEntertain   : UIView!

and The initialization all have

let delay = 0.1 * Double(NSEC_PER_SEC)
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue(), {
self.circleSlider.value = Float(self.reviwesRoundTwo[0])
})
but only last slide shows the correct
12

complete source

 private func buildCircleSliderFoodQSlider() {
        self.circleSlider = CircleSlider(frame: self.FoodQSlider.bounds, options: self.sliderOptions)

        let delay = 0.1 * Double(NSEC_PER_SEC)
        let time  = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
        dispatch_after(time, dispatch_get_main_queue(), {
            self.circleSlider.value = Float(self.reviwesRoundTwo[0])
        })
        self.FoodQSlider.addSubview(self.circleSlider!)
        self.valueLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
        self.valueLabel.textAlignment = .Center
        self.valueLabel.center = CGPoint(x: CGRectGetWidth(self.circleSlider.bounds) * 0.5, y: CGRectGetHeight(self.circleSlider.bounds) * 0.5)
        self.valueLabel.text = String(reviwesRoundTwo[0])
        self.circleSlider.addSubview(self.valueLabel)
    }

Swift4~

Will the library work in new Xcode and Swift 4 environments?

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.