All Projects → kyleweiner → Kwstepper

kyleweiner / Kwstepper

Licence: mit
A stepper control with flexible UI and tailored UX.

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Kwstepper

FlexyStepper
Stepper motor control library for Arduino supporting in motion changes
Stars: ✭ 41 (-75.6%)
Mutual labels:  stepper
Materialdesignextensions
Material Design Extensions is based on Material Design in XAML Toolkit to provide additional controls and features for WPF apps
Stars: ✭ 516 (+207.14%)
Mutual labels:  stepper
Stepbarview
Step Bar View (make your own customized StepBar)
Stars: ✭ 97 (-42.26%)
Mutual labels:  stepper
Laser-XY-Scanner
Low Cost DIY Laser XY Scanner, Cutter, or Engraver
Stars: ✭ 27 (-83.93%)
Mutual labels:  stepper
Bs Stepper
A stepper for Bootstrap 4.x
Stars: ✭ 261 (+55.36%)
Mutual labels:  stepper
Package im stepper
A growing collection of beautiful, easy to use, stepper and page indicator widgets.
Stars: ✭ 42 (-75%)
Mutual labels:  stepper
ng-wizard
Angular Wizard - Stepper
Stars: ✭ 65 (-61.31%)
Mutual labels:  stepper
React Native Input Spinner
An extensible input number spinner component for react-native highly customizable. This component enhance a text input for entering numeric values, with increase and decrease buttons.
Stars: ✭ 155 (-7.74%)
Mutual labels:  stepper
Stepper
Animated numeric stepper component which can be used to increment or decrement a value by clicking arrows.
Stars: ✭ 351 (+108.93%)
Mutual labels:  stepper
Material Steppers
Angular Steppers directive for Angular Material
Stars: ✭ 95 (-43.45%)
Mutual labels:  stepper
pololu-tic-software
Software and drivers for the Pololu Tic Stepper Motor Controller.
Stars: ✭ 16 (-90.48%)
Mutual labels:  stepper
react-native-simple-stepper
A super simple react-native implementation of the UIStepper control from iOS.
Stars: ✭ 100 (-40.48%)
Mutual labels:  stepper
Easystepindicator
More attributes for a step indicator, indicates steps with a easy way
Stars: ✭ 78 (-53.57%)
Mutual labels:  stepper
motor-hat
Node Module to control Adafruits MotorHAT for the RaspberryPi
Stars: ✭ 28 (-83.33%)
Mutual labels:  stepper
Ode4j
Java 3D Physics Engine & Library
Stars: ✭ 105 (-37.5%)
Mutual labels:  stepper
xblinds
HTTP and MQTT controller for vertical blinds
Stars: ✭ 60 (-64.29%)
Mutual labels:  stepper
Steppers
Steppers view library for Android, based on Google Material design guidelines
Stars: ✭ 786 (+367.86%)
Mutual labels:  stepper
React Use Wizard
🧙 A React wizard (stepper) builder without the hassle, powered by hooks.
Stars: ✭ 162 (-3.57%)
Mutual labels:  stepper
React Stepper
Well-designed stepper component for react
Stars: ✭ 108 (-35.71%)
Mutual labels:  stepper
Vue Stepper
👨🏻‍🚀 A renderless component for composing a Stepper
Stars: ✭ 90 (-46.43%)
Mutual labels:  stepper

KWStepper

Version Carthage Documentation Platform License

KWStepper is a stepper control written in Swift. Unlike UIStepper, KWStepper allows for a fully customized UI and provides callbacks for tailoring the UX.

KWStepper Screenshot

KWStepper was initially created in Objective-C for Addo Label's Counters• and is now available in Swift for you to enjoy 😁

Features

  • Allows for a fully customized UI.
  • Provides properties for setting different decrement and increment steps.
  • Offers optional callbacks for responding to control events and tailoring the UX.
  • Supports method chaining for easier configuration and event handling.

Installation

CocoaPods

KWStepper is available through CocoaPods. To install it, simply add the following lines to your Podfile:

use_frameworks!
pod 'KWStepper'

Carthage

To integrate KWStepper using Carthage, add the following line to you Cartfile:

github "kyleweiner/KWStepper"

Swift Package Manager

To add KWStepper to your Xcode project via Swift Package Manager, select File → Swift Packages → Add Package Dependency… and enter the URL for this repository.

Manually

If you prefer not to use a dependency manager, simply copy the source files into your project.

Usage

Try the example project!

var stepper: KWStepper!

@IBOutlet weak var countLabel: UILabel!
@IBOutlet weak var decrementButton: UIButton!
@IBOutlet weak var incrementButton: UIButton!
stepper = KWStepper(decrementButton: decrementButton, incrementButton: incrementButton)

Respond to control events using the valueChangedCallback property.

stepper.valueChangedCallback = { stepper in
    self.countLabel.text = String(stepper.value)
}

Or, use the target-action pattern.

stepper.addTarget(self, action: #selector(stepperDidChange), for: .valueChanged)

Configuring KWStepper

With the exception of the continuous property, KWStepper offers everything provided by UIStepper and more.

stepper.autoRepeat = true
stepper.autoRepeatInterval = 0.10
stepper.wraps = true
stepper.minimumValue = 0
stepper.maximumValue = 8
stepper.value = 0
stepper.incrementStepValue = 1
stepper.decrementStepValue = 1

Method chaining is also supported:

stepper
    .wraps(true)
    .maximumValue(10)
    .stepValue(2)
    .valueChanged { stepper in
        // ...
    }

If necessary, the rounding behavior for incrementing and decrementing may be modified via roundingBehavior.

KWStepperDelegate

Adopting KWStepperDelegate provides the following optional delegate methods for tailoring the UX.

  • optional func KWStepperDidDecrement()
  • optional func KWStepperDidIncrement()
  • optional func KWStepperMaxValueClamped()
  • optional func KWStepperMinValueClamped()
  • optional func KWStepperDidEndLongPress()

Callbacks

KWStepper provides the following callbacks:

  • valueChangedCallback
  • decrementCallback
  • incrementCallback
  • maxValueClampedCallback
  • minValueClampedCallback
  • longPressEndedCallback

Method chaining is supported for callbacks too:

stepper
    .valueChanged { _ in }
    .didDecrement { _ in }
    .didIncrement { _ in }
    .maxValueClamped { _ in }
    .minValueClamped { _ in }
    .longPressEnded { _ in }

// `maxValueClampedCallback` and `minValueClampedCallback` may be set simultaneously.
stepper.valueClamped { stepper in
    // ...
}

In the example project, valueChanged(_:) is used to update the count label text when the stepper value changes. valueClamped(:_) is used to present a UIAlertController when a limit is reached and the wraps property is set to false.

Author

KWStepper was written by Kyle Weiner and contributors.

License

KWStepper is available under the MIT license. See the LICENSE file for details.

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].