bryanjclark/SwiftTweaks

Changing a tweak with a value > 100 causes the tweak to return to 100

Closed this issue · 5 comments

If the initial Int tweak value is set to say 150, and you hit the plus button, the value changes to 101. If you hit the minus button, it changes to 99. Setting a defaultValue while creating the tweak doesn't fix it either.

Thanks for the report, @anuragt84!

Do you have some sample code that reproduces the issue? I'm curious to check out a couple of things:

  1. This Tweak init method should prevent you from creating a Tweak where the defaultValue is larger than the maxValue.
  2. There's some code in TweakViewData here that sounds a potential cause of the issue - if you send up some sample code that reproduces the issue I'm happy to check it out!

Cheers, and thanks again for the report!

Welp, I'm 100% able to repro. Gonna add a fix here...

Ah, just realized what it is - we're setting the value on UIStepper before we set the minimum/maximum levels. Fix incoming!

Thank you so much. Sorry I couldn't be of much help.

On Oct 5, 2016, at 4:55 PM, Bryan Clark notifications@github.com wrote:

Ah, just realized what it is - we're setting the value on UIStepper before we set the minimum/maximum levels. Fix incoming!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

No worries at all! I really appreciate the bug report!