A question for logic. There is a standard UISlider, which, as the value increases, should decrease, respectively, with the alpha UIImage located on the same View.

max-min values:

  • UISlider: 0 - 100
  • UIImage.alpha = 1 - 0

That is the question, as I understand it, about the algorithm, which in will establish the corresponding ratios of values, for example: 0.99 - 0.01, 0.98 - 0.02 ... etc.



    1 answer 1

    Required algorithm:

      image.value = 1 - (slider.value / slider.maximumValue);