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

stepper in tableViewCell #18

Open
longxianlin opened this issue Oct 30, 2015 · 5 comments
Open

stepper in tableViewCell #18

longxianlin opened this issue Oct 30, 2015 · 5 comments
Labels

Comments

@longxianlin
Copy link

    let qytStepper = cell.viewWithTag(97) as! GMStepper
    qytStepper.labelFont = UIFont.systemFontOfSize(15.0)
    qytStepper.minimumValue = 0
    qytStepper.layer.borderWidth = 1.0
    qytStepper.layer.borderColor = UIColor.lightGrayColor().CGColor
    qytStepper.tag = indexPath.row
    qytStepper.addTarget(self, action: "stepperValueChanged:", forControlEvents: .ValueChanged)

not working

@gmertk
Copy link
Owner

gmertk commented Nov 1, 2015

Hi @longxianlin, can you elaborate on what is not working?

@mihaibulic
Copy link

I'm also having an issue with GMStepper in a tableviewcell.

I don't have the issue quite pinned down yet, but occasionally when quickly scrolling through the list, I'll see this issue:

`
@IBAction func onStepperValueChanged(_ sender: GMStepper) {
print("stepper (sender.value)) // this line runs 2nd, value is 2
}

// MARK: Local Func
func setContent(quantity: Double) {
    stepper.value = quantity
    print("set content: \(stepper.value)") // this line runs 1st, value is 1

`

@kalmicka
Copy link

I am having the same issue. I have the stepper in 10 rows in a Uitableviewcell. If you start scrolling the addTarget method fires even though the button was not touched. I guess it is firing once the cell gets dequeued. Anyway to fix that behavior?

@Elshad
Copy link

Elshad commented Jun 5, 2017

@kalmicka
cell.stepper.value = count
Setting value to stepper programmatically also fire .ValueChanged event. Maybe you set value to stepper somewhere in cellForRowAt

@Dave181295
Copy link

Any solution to this?

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

No branches or pull requests

6 participants