All Projects → BalestraPatrick → Valuestepper

BalestraPatrick / Valuestepper

Licence: mit
A Stepper object that displays its value.

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Valuestepper

Nbaseuikit
个人平时使用的一些Qt编写的组件(有部分是整合的开源作品,部分是自己原创);
Stars: ✭ 286 (-16.62%)
Mutual labels:  uikit
Chakra Ui
⚡️Simple, Modular & Accessible UI Components for your React Applications
Stars: ✭ 295 (-13.99%)
Mutual labels:  uikit
Alchemy
An experimental GUI framework for Rust, backed by per-platform native widgets. React, AppKit/UIKit inspired. EXPERIMENTAL, runs on Cocoa right now. ;P
Stars: ✭ 321 (-6.41%)
Mutual labels:  uikit
Contraflutterkit
A Flutter UI kit with 50 plus screens for beginners to learn.
Stars: ✭ 288 (-16.03%)
Mutual labels:  uikit
Swiftui Cheat Sheet
SwiftUI 2.0 Cheat Sheet
Stars: ✭ 3,417 (+896.21%)
Mutual labels:  uikit
Wlemptystate
WLEmptyState is an iOS based component that lets you customize the view when the dataset of a UITableView or a UICollectionView is empty. We created a sample project with the WLEmptyState component to show how you can use it.
Stars: ✭ 305 (-11.08%)
Mutual labels:  uikit
Chakra Ui
⚡️ Simple, Modular & Accessible UI Components for your React Applications
Stars: ✭ 22,745 (+6531.2%)
Mutual labels:  uikit
Swift Composable Architecture
A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
Stars: ✭ 5,199 (+1415.74%)
Mutual labels:  uikit
Mbtileparser
MBTileParser is a game engine written using pure UIKit in the days before SpriteKit.
Stars: ✭ 297 (-13.41%)
Mutual labels:  uikit
Uix Kit
A free UI toolkit based on some common libraries for building beautiful responsive website, compatible with Bootstrap v4.
Stars: ✭ 318 (-7.29%)
Mutual labels:  uikit
Wtrequestcenter
WTKit is my Code accumulation
Stars: ✭ 293 (-14.58%)
Mutual labels:  uikit
Deskapp
DeskApp Admin is a free to use Bootstrap 4 admin template.
Stars: ✭ 296 (-13.7%)
Mutual labels:  uikit
Reactionbutton
Since Facebook introduced reactions in 2016, it became a standard in several applications as a way for users to interact with content. ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.
Stars: ✭ 305 (-11.08%)
Mutual labels:  uikit
Framework Codeidea
System file classification
Stars: ✭ 289 (-15.74%)
Mutual labels:  uikit
Chatkit
Android library. Flexible components for chat UI implementation with flexible possibilities for styling, customizing and data management. Made by Stfalcon
Stars: ✭ 3,496 (+919.24%)
Mutual labels:  uikit
Material Bread
Cross Platform React Native Material Design Components
Stars: ✭ 287 (-16.33%)
Mutual labels:  uikit
Metaballs
Blob effect implementation with UIKIt
Stars: ✭ 300 (-12.54%)
Mutual labels:  uikit
Swiftreorder
Easy UITableView drag-and-drop cell reordering
Stars: ✭ 340 (-0.87%)
Mutual labels:  uikit
Onboardkit
Customisable user onboarding for your iOS app
Stars: ✭ 334 (-2.62%)
Mutual labels:  uikit
Compositional Layouts Kit
📏 A set of advanced compositional layouts for UICollectionView with examples [Swift 5.3, iOS 13].
Stars: ✭ 317 (-7.58%)
Mutual labels:  uikit

ValueStepper

Carthage compatible Version License Platform

Description

ValueStepper is an improved replication of Apple's UIStepper object. The problem with UIStepper is that it doesn't display the value to the user. I was tired of creating a simple UILabel just to show the value in the UI. ValueStepper integrates the value in a UILabel between the increase and decrease buttons. It's as easy as that.

Usage

To see it in action, run the example project, clone the repo, and run pod install from the Example directory first. The example project shows how to set up ValueStepper in Storyboard.

Storyboard

Drag a UIView object and set the class to ValueStepper (if needed set the module to ValueStepper too). You can now customize all the properties in IB such as the minimumValue, tintColor and so on. Make sure to set the width to 149 and the height to 29 which are the default values. Create an @IBAction on the ValueChanged control event to be notified when the value changes.

Programmatically

import ValueStepper

let valueStepper: ValueStepper = {
    let stepper = ValueStepper()
    stepper.tintColor = .whiteColor()
    stepper.minimumValue = 0
    stepper.maximumValue = 1000
    stepper.stepValue = 100
    return stepper
}()

override func viewDidLoad() {
    super.viewDidLoad()       
    valueStepper.addTarget(self, action: "valueChanged:", forControlEvents: .ValueChanged)
}

@IBAction func valueChanged1(sender: ValueStepper) {
    // Use sender.value to do whatever you want
}

Customizations

These are the available properties with the relative documentation.

/// Current value and sends UIControlEventValueChanged when modified.
@IBInspectable public var value: Double = 0.0
    
/// Minimum value that must be less than the maximum value.
@IBInspectable public var minimumValue: Double = 0.0 
    
/// Maximum value that must be greater than the minimum value.
@IBInspectable public var maximumValue: Double = 1.0
    
/// When set to true, the user can tap the label and manually enter a value.
@IBInspectable public var enableManualEditing: Bool = false
    
/// The value added/subtracted when one of the two buttons is pressed.
@IBInspectable public var stepValue: Double = 0.1
    
/// When set to true, keeping a button pressed will continuously increase/decrease the value every 0.1s.
@IBInspectable public var autorepeat: Bool = true

/// The background color of the stepper buttons while pressed.
@IBInspectable public var highlightedBackgroundColor: UIColor = UIColor(white: 1.0, alpha: 0.1)

/// The color of the +/- icons when in disabled state.
@IBInspectable public var disabledIconButtonColor: UIColor = UIColor.gray

/// The color of the +/- buttons background when in disabled state.
@IBInspectable public var disabledBackgroundButtonColor: UIColor = UIColor.clear

/// The background color of the plus and minus buttons.
@IBInspectable public var backgroundButtonColor: UIColor = UIColor.clear
    
/// The background color of the center view that contains the value label.
@IBInspectable public var backgroundLabelColor: UIColor = UIColor.clear
    
/// The text color of the value label in positioned in the center.
@IBInspectable public var labelTextColor: UIColor = UIColor.white
    
/// Describes the format of the value.
public var numberFormatter: NumberFormatter
    
// Default width of the stepper. Taken from the official UIStepper object.
public let defaultWidth = 141.0
    
// Default height of the stepper. Taken from the official UIStepper object.
public let defaultHeight = 29.0

/// Value label that displays the current value displayed at the center of the stepper.
public let valueLabel: UILabel

Installation

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

pod 'ValueStepper'

You can also use Carthage if you prefer. Add this line to your Cartfile.

github "BalestraPatrick/ValueStepper"

Requirements

iOS 8.3 and Swift 4.0 are required.

Author

I'm Patrick Balestra. Email: [email protected] Twitter: @BalestraPatrick.

License

ValueStepper is available under the MIT license. See the LICENSE file for more info.

Inspired by GMStepper. Thanks to Gmertk for the interesting and useful related blog post.

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