Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
joncardasis authored Aug 10, 2016
1 parent d2a8876 commit ccf66ff
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@
A fun Swift UIControl for picking a size.
![Demo Animation](../assets/demo.gif?raw=true)

## Documentation
+ `init(condensedFrame: CGRect)` will set the frame of where the condensed frame should lie (width and height should be equal)
+ `init(frame: CGRect)` will set the frame of where the frame should lie when fully expanded
+ `currentSize` to obtain the size the person has selected
+ `handlePadding` sets the padding around the handle (default is the left side's radius). Works best as <= leftSideRadius
+ `handle.color` is the slider's handle color
+ `trackColor` is the color of the track
+ `value` is a value between 0 and 1.0 of where the handle was positioned relative on the track
+ `leftSideRadius` and `rightSideRadius` return the radii of the left and right sides of the frame when expanded
+ `currentState` returns if the control is condensed or expanded


## Supported UIControlEvents
+ `TouchUpInside` is called when a tap on the control is released
+ `ValueChanged` is called when the slider is moved
+ `TouchDown` is called both when a long press is detected or a regular touch is detected
+ `TouchDragFinished` (A custom UIControlEvent) is called when the slider has selected a new value and been released

## Installation
### Cocoapods
Add `pod 'SizeSlideButton'` to your Podfile.
Expand Down Expand Up @@ -56,5 +38,24 @@ Output:

<img src="../assets/darkScreenshot.png?raw=true" width="350">

## Documentation
+ `init(condensedFrame: CGRect)` will set the frame of where the condensed frame should lie (width and height should be equal)
+ `init(frame: CGRect)` will set the frame of where the frame should lie when fully expanded
+ `currentSize` to obtain the size the person has selected
+ `handlePadding` sets the padding around the handle (default is the left side's radius). Works best as <= leftSideRadius
+ `handle.color` is the slider's handle color
+ `trackColor` is the color of the track
+ `value` is a value between 0 and 1.0 of where the handle was positioned relative on the track
+ `leftSideRadius` and `rightSideRadius` return the radii of the left and right sides of the frame when expanded
+ `currentState` returns if the control is condensed or expanded


## Supported UIControlEvents
+ `TouchUpInside` is called when a tap on the control is released
+ `ValueChanged` is called when the slider is moved
+ `TouchDown` is called both when a long press is detected or a regular touch is detected
+ `TouchDragFinished` (A custom UIControlEvent) is called when the slider has selected a new value and been released


## License
SizeSlideButton is available under the MIT license. See the LICENSE file for more info.

0 comments on commit ccf66ff

Please sign in to comment.