All Projects → joncardasis → Sizeslidebutton

joncardasis / Sizeslidebutton

Licence: mit
A fun Swift UIControl for picking a size

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Sizeslidebutton

Stepslider
StepSlider its custom implementation of slider such as UISlider for preset integer values.
Stars: ✭ 391 (+750%)
Mutual labels:  cocoapods, slider
Simple Slider
🎠 The 1kb JavaScript Carousel
Stars: ✭ 583 (+1167.39%)
Mutual labels:  slider, slide
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (+843.48%)
Mutual labels:  cocoapods, ios-animation
Mevfloatingbutton
An iOS drop-in UITableView, UICollectionView and UIScrollView superclass category for showing a customizable floating button on top of it.
Stars: ✭ 301 (+554.35%)
Mutual labels:  cocoapods, ios-animation
Tkswitchercollection
An animation switch collection
Stars: ✭ 877 (+1806.52%)
Mutual labels:  cocoapods, ios-animation
Efcountinglabel
Adds animated counting support to UILabel.
Stars: ✭ 311 (+576.09%)
Mutual labels:  cocoapods, button
Hooper
🎠 A customizable accessible carousel slider optimized for Vue
Stars: ✭ 561 (+1119.57%)
Mutual labels:  slider, slide
awesome-web-styling
Awesome Web Styling with CSS Animation Effects ⭐️
Stars: ✭ 109 (+136.96%)
Mutual labels:  slide, button
Ppnumberbutton
iOS中一款高度可定制性商品计数按钮(京东/淘宝/饿了么/美团外卖/百度外卖样式)
Stars: ✭ 845 (+1736.96%)
Mutual labels:  cocoapods, button
Vue Concise Slider
vue-concise-slider,A simple vue sliding component
Stars: ✭ 831 (+1706.52%)
Mutual labels:  slider, slide
Gemini
Gemini is rich scroll based animation framework for iOS, written in Swift.
Stars: ✭ 2,965 (+6345.65%)
Mutual labels:  cocoapods, ios-animation
Ftpopovermenu
FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.
Stars: ✭ 988 (+2047.83%)
Mutual labels:  cocoapods, button
SlidableImage
Fancy slider for before&after images
Stars: ✭ 32 (-30.43%)
Mutual labels:  slide, slider
Mevhorizontalcontacts
An iOS UICollectionViewLayout subclass to show a list of contacts with configurable expandable items.
Stars: ✭ 358 (+678.26%)
Mutual labels:  cocoapods, ios-animation
jquery-rsSliderLens
UI slider control that magnifies the current value
Stars: ✭ 20 (-56.52%)
Mutual labels:  slide, control
Pinterestsegment
A Pinterest-like segment control with masking animation.
Stars: ✭ 560 (+1117.39%)
Mutual labels:  cocoapods, ios-animation
cachu-slider
🌈 🔆 Create animated full screen and content-fit sliders efficiently.
Stars: ✭ 30 (-34.78%)
Mutual labels:  slide, slider
slack widgets
An abstraction of the JSON structure needed to create widgets in Slack message attachments
Stars: ✭ 14 (-69.57%)
Mutual labels:  button, picker
React Zmage
一个基于 React 的可缩放图片控件 | A scalable image wrapper power by react
Stars: ✭ 713 (+1450%)
Mutual labels:  slider, slide
React Whirligig
A react carousel/slider like component for sequentially displaying slides or sets of slides
Stars: ✭ 20 (-56.52%)
Mutual labels:  slider, slide

SizeSlideButton

Supported Version Platform License CocoaPods

A fun Swift UIControl for picking a size. Demo Animation

Installation

Cocoapods

Add pod 'SizeSlideButton' to your Podfile.

Manually

Add the SizeSlideButton.swift class to your project.

Examples

let condensedFrame = CGRect(x: 280, y: 70, width: 32, height: 32) //Width and Height should be equal
let fancyControl = SizeSlideButton(condensedFrame: condensedFrame)

fancyControl.trackColor = UIColor(red: 38/255, green: 50/255, blue: 56/255, alpha: 1)
fancyControl.handle.color = UIColor.white
fancyControl.addTarget(self, action: #selector(newSizeSelected), for: .touchDragFinished)
fancyControl.addTarget(self, action: #selector(sizeSliderTapped), for: .touchUpInside)
self.view.addSubview(fancyControl)


func newSizeSelected(_ sender: SizeSlideButton){
    //Do something once a size is selected and the control let go
    // You can now use the senders .value for a value between 0 and 1
    // Or use the handle's height (handle.height) as a multiplier for size
    print("Value: \(sender.value)")
    print("Size multiplier: \(sender.handle.height)")

    // Ex: self.paintbrush.brushSize = kDefaultBrushSize * sender.handle.height
}

func sizeSliderTapped(_ sender: SizeSlideButton){
    //Do something when the button is tapped
    print("Tip Tap")
 }

Output:

Via Interface Builder

SizeSlideButton can also be created right from the Interface Builder and allows basic properties to be edited.

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
  • handle.height/handle.width gets the sizes of the handle and can be best used as a multiplier against a constant default size
  • 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
  • animationType specifies the animation type used when letting go of the control

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].