{"id":2779,"url":"https://github.com/BalestraPatrick/ValueStepper","last_synced_at":"2025-08-03T12:31:05.939Z","repository":{"id":47763462,"uuid":"52085112","full_name":"BalestraPatrick/ValueStepper","owner":"BalestraPatrick","description":"A Stepper object that displays its value.","archived":false,"fork":false,"pushed_at":"2019-04-27T22:01:12.000Z","size":515,"stargazers_count":395,"open_issues_count":7,"forks_count":46,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-24T00:47:49.758Z","etag":null,"topics":["uikit","uistepper","value"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BalestraPatrick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-19T12:05:25.000Z","updated_at":"2024-09-08T14:16:57.000Z","dependencies_parsed_at":"2022-07-21T17:32:47.910Z","dependency_job_id":null,"html_url":"https://github.com/BalestraPatrick/ValueStepper","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BalestraPatrick%2FValueStepper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BalestraPatrick%2FValueStepper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BalestraPatrick%2FValueStepper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BalestraPatrick%2FValueStepper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BalestraPatrick","download_url":"https://codeload.github.com/BalestraPatrick/ValueStepper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228543087,"owners_count":17934426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["uikit","uistepper","value"],"created_at":"2024-01-05T20:16:22.634Z","updated_at":"2024-12-07T00:30:52.581Z","avatar_url":"https://github.com/BalestraPatrick.png","language":"Swift","readme":"# ValueStepper\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Version](https://img.shields.io/cocoapods/v/ValueStepper.svg?style=flat)](http://cocoapods.org/pods/ValueStepper)\n[![License](https://img.shields.io/cocoapods/l/ValueStepper.svg?style=flat)](http://cocoapods.org/pods/ValueStepper)\n[![Platform](https://img.shields.io/cocoapods/p/ValueStepper.svg?style=flat)](http://cocoapods.org/pods/ValueStepper)\n\n![](Resources/animation.gif)\n\n## Description\n`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.\n\n## Usage\nTo 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. \n\n### Storyboard\nDrag 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.\n![](Resources/storyboard.png)\n\n### Programmatically\n```swift\nimport ValueStepper\n\nlet valueStepper: ValueStepper = {\n    let stepper = ValueStepper()\n    stepper.tintColor = .whiteColor()\n    stepper.minimumValue = 0\n    stepper.maximumValue = 1000\n    stepper.stepValue = 100\n    return stepper\n}()\n\noverride func viewDidLoad() {\n    super.viewDidLoad()       \n    valueStepper.addTarget(self, action: \"valueChanged:\", forControlEvents: .ValueChanged)\n}\n\n@IBAction func valueChanged1(sender: ValueStepper) {\n    // Use sender.value to do whatever you want\n}\n```\n\n## Customizations\nThese are the available properties with the relative documentation.\n\n```swift\n/// Current value and sends UIControlEventValueChanged when modified.\n@IBInspectable public var value: Double = 0.0\n    \n/// Minimum value that must be less than the maximum value.\n@IBInspectable public var minimumValue: Double = 0.0 \n    \n/// Maximum value that must be greater than the minimum value.\n@IBInspectable public var maximumValue: Double = 1.0\n    \n/// When set to true, the user can tap the label and manually enter a value.\n@IBInspectable public var enableManualEditing: Bool = false\n    \n/// The value added/subtracted when one of the two buttons is pressed.\n@IBInspectable public var stepValue: Double = 0.1\n    \n/// When set to true, keeping a button pressed will continuously increase/decrease the value every 0.1s.\n@IBInspectable public var autorepeat: Bool = true\n\n/// The background color of the stepper buttons while pressed.\n@IBInspectable public var highlightedBackgroundColor: UIColor = UIColor(white: 1.0, alpha: 0.1)\n\n/// The color of the +/- icons when in disabled state.\n@IBInspectable public var disabledIconButtonColor: UIColor = UIColor.gray\n\n/// The color of the +/- buttons background when in disabled state.\n@IBInspectable public var disabledBackgroundButtonColor: UIColor = UIColor.clear\n\n/// The background color of the plus and minus buttons.\n@IBInspectable public var backgroundButtonColor: UIColor = UIColor.clear\n    \n/// The background color of the center view that contains the value label.\n@IBInspectable public var backgroundLabelColor: UIColor = UIColor.clear\n    \n/// The text color of the value label in positioned in the center.\n@IBInspectable public var labelTextColor: UIColor = UIColor.white\n    \n/// Describes the format of the value.\npublic var numberFormatter: NumberFormatter\n    \n// Default width of the stepper. Taken from the official UIStepper object.\npublic let defaultWidth = 141.0\n    \n// Default height of the stepper. Taken from the official UIStepper object.\npublic let defaultHeight = 29.0\n\n/// Value label that displays the current value displayed at the center of the stepper.\npublic let valueLabel: UILabel\n```\n\n## Installation\n\nValueStepper is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your `Podfile`:\n\n```ruby\npod 'ValueStepper'\n```\n\nYou can also use [Carthage](https://github.com/Carthage/Carthage) if you prefer. Add this line to your `Cartfile`.\n\n```ruby\ngithub \"BalestraPatrick/ValueStepper\"\n```\n## Requirements\niOS 8.3 and Swift 4.0 are required.\n\n- If you are using Swift 5, use the [master branch](https://github.com/BalestraPatrick/ValueStepper/tree/master).\n- If you are using Swift 4.2, use the [swift-4.2 branch](https://github.com/BalestraPatrick/ValueStepper/tree/swift-4.2).\n- If you are using Swift 3.2, use the [swift-3.2 branch](https://github.com/BalestraPatrick/ValueStepper/tree/swift-3.2).\n- If you are using Swift 2.3, use the [swift-2.3 branch](https://github.com/BalestraPatrick/ValueStepper/tree/swift-2.3).\n\n## Author\n\nI'm [Patrick Balestra](http://www.patrickbalestra.com).\nEmail: [me@patrickbalestra.com](mailto:me@patrickbalestra.com)\nTwitter: [@BalestraPatrick](http://twitter.com/BalestraPatrick).\n\n## License\n\n`ValueStepper` is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n\nInspired by [GMStepper](https://github.com/gmertk/GMStepper). Thanks to [Gmertk](https://github.com/gmertk) for the interesting and useful related [blog post](http://gmertk.github.io/custom-stepper-part-1).\n","funding_links":[],"categories":["UI"],"sub_categories":["Stepper","Layout","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBalestraPatrick%2FValueStepper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBalestraPatrick%2FValueStepper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBalestraPatrick%2FValueStepper/lists"}