Skip to content

Various fixes and improvements #16

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

Open
wants to merge 2 commits into
base: swift3
Choose a base branch
from
Open

Conversation

mjrehder
Copy link

Summary

  • Using StyledLabel pod
  • Fixed background style masking
  • Fixed symbol label background color issue
  • Added format string
  • Added step factor for value sliding

Background color issue
There was no way to apply a styling with a background color and masking the background to the various styling options.
In order to fix this, you need to have a dedicated property for the style color. The property is called styleColor.
You can still use the backgroundColor property as before, but it will not mask to the selected style.
Most of the work for this fix was already done in the StyledLabel pod (Framework), so I removed the classes from this project and added the framework reference to the podfile.

Symbol label background
After the symbols were pressed, the symbol background was set to backgroundColor (now styleColor), it must be reverted to .clear color.

Format String
In order to correctly format values in the thumb, you must have a way to specify the formatting. This PR introduces the thumbTextFormatString. Default is 'nil', which results in the old behaviour.
An example of how bad the UI looks without formatting is by using a [0;1] range with a 0.1 step value and apply sliding. The thumb text will show "0.7239749579" or similar.

Step Factor
When sliding the stepper, then the increase/decrease of the value is fine as long you are operating on integers. A multiplying factor is needed when you have floating point values.

The examples have been updated to reflect the changes and demonstrations of the new features are included in the examples.

It would be nice with a new major release of this library, as the current release is based on Swift 2.3 and that version is no longer available in the current Xcode.

Martin Rehder added 2 commits May 25, 2017 09:56
Fixed background style masking
Fixed symbol label background color issue
Added format string
Added step factor for value sliding
@mjrehder
Copy link
Author

mjrehder commented Jun 1, 2017

Any comments on this PR?

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

Successfully merging this pull request may close these issues.

1 participant