SwiftUI library to create fully customizable input stepper.

Overview

SwiftUI-InputStepper

Codacy Badge Building and testing

Swift package for creating numerical input stepper.

Example of input stepper An example of input stepper created with this library

It supports long press gesture Input stepper has option to handle long press. You can press the +/- button and hold it for few seconds. In that time the value will be changing with the adjustable speed and step.

Instalation

In Xcode go to File -> Swift Packages -> Add Package Dependency and paste in the repo's url: https://github.com/mateusz800/InputStepper

Make sure that you have added the library in your project target. Target name -> General -> Frameworks, Libraries and Embedded Content

Usage

Import the package in the file you would like to use it:

import InputStepper

InputStepper library shares three components that allows you to build your fully customizable input stepper. Among them are Value, PlusButton and MinusButton. Each of them have to be included inside InputStepper view.

Basic example:

@State var value:Float = 0
...
InputStepper($value) {
    HStack {
        MinusButton()
        Value()
        PlusButton()
    }
}

The result of any interaction with input stepper will be available in declared value state variable.

Customization

Plus/Minus button

You can modify MinusButton and PlusButton by defining how it should look like. Define some new view and pass it as a parameter

MinusButton(){
    Text("This is a minus button")
}

Value

You can customize the view of displayed value. Simply pass appropriate values in the constructor. All parameters are optional.

  • decimalPlaces: Int - how many digits shuld be visible after dot/comma
  • unit: String - unit that will be visible after value
  • font: Font
  • fontWeight: Font.Weight
Value(
    decimalPlaces: 2,
    unit: "cm",
    font: .system(size: 20),
    fontWeight: .bold
)

You can also customize your input stepper via the following modificators:

  • .withStep(step:) - edit step value
InputStepper($value) {
    ...
}.withStep(step: 0.5)

Contributing

Contributions are always welcome!

Show your support

Give a ⭐️ if this project helped you!

You might also like...
Pigeon is a SwiftUI and UIKit library that relies on Combine to deal with asynchronous data.

Pigeon 🐦 Introduction Pigeon is a SwiftUI and UIKit library that relies on Combine to deal with asynchronous data. It is heavily inspired by React Qu

🚀Comprehensive Redux library for SwiftUI, ensures State consistency across Stores with type-safe pub/sub pattern.
🚀Comprehensive Redux library for SwiftUI, ensures State consistency across Stores with type-safe pub/sub pattern.

🚀Comprehensive Redux library for SwiftUI, ensures State consistency across Stores with type-safe pub/sub pattern.

Unit-Converter-SwiftUI - A simple Unit Converter iOS app built in the process of learning SwiftUI
Unit-Converter-SwiftUI - A simple Unit Converter iOS app built in the process of learning SwiftUI

SwiftUI-Unit-Converter A simple Unit Converter iOS app built in the process of l

macOS system library in Swift

SystemKit A macOS system library in Swift based off of libtop, from Apple's top implementation. For an example usage of this library, see dshb, a macO

Swift library to develop custom Alexa Skills
Swift library to develop custom Alexa Skills

AlexaSkillsKit AlexaSkillsKit is a Swift library that allows you to develop custom skills for Amazon Alexa, the voice service that powers Echo. It tak

🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift

Bow is a cross-platform library for Typed Functional Programming in Swift. Documentation All documentation and API reference is published in our websi

Butterfly is a lightweight library for integrating bug-report and feedback features with shake-motion event.
Butterfly is a lightweight library for integrating bug-report and feedback features with shake-motion event.

Butterfly is a lightweight library for integrating bug-report and feedback features with shake-motion event. Goals of this project One of th

Focus is an Optics library for Swift (where Optics includes Lens, Prisms, and Isos)

Focus Focus is an Optics library for Swift (where Optics includes Lens, Prisms, and Isos) that is inspired by Haskell's Lens library. Introduction Foc

📘A library for isolated developing UI components and automatically taking snapshots of them.
📘A library for isolated developing UI components and automatically taking snapshots of them.

A library for isolated developing UI components and automatically taking snapshots of them. Playbook Playbook is a library that provides a sandbox for

Releases(v1.0.0)
Owner
Mateusz Budnik
Mateusz Budnik
A basic iOS app that takes input from the user, displays it, allows changing both text color and background color.

Hello-iOSApp App Description A basic iOS app that takes input from the user, displays it, allows changing both text color and background color. App Wa

null 0 Jan 8, 2022
Recreating a fully functional version of iOS 4 in SwiftUI.

Updates: Version 1.0 is currently available ?? While I work on fixing an issue in Xcode 12.5+ with LazyVGrid, I recommend you build using Xcode 12.4 a

null 2.9k Jan 1, 2023
A most fully customization calendar for Apple platforms 📅

KVKCalendar KVKCalendar is a most fully customization calendar. Library consists of five modules for displaying various types of calendar (day, week,

Kviatkovskii Sergei 353 Jan 5, 2023
ZIP Foundation is a library to create, read and modify ZIP archive files.

ZIP Foundation is a library to create, read and modify ZIP archive files. It is written in Swift and based on Apple's libcompression for high performa

Thomas Zoechling 1.9k Dec 27, 2022
MediaType is a library that can be used to create Media Types in a type-safe manner.

This is a general purpose Swift library for a concept of typed treatment for Media Types. We use this library on clients and servers to speak the same dialect and to enjoy all the comfort strong types provide over raw strings.

21Gram Consulting 79 Jul 19, 2022
A customizable sheet for SwiftUI.

Bottom Sheet A customizable sheet for SwiftUI. Choose between medium and large, select background, set corner radius and optional display of the indic

DW 4 Jan 1, 2023
Swift Package Manager plugin which runs ActionBuilder to create a Github Actions workflow for a swift package.

ActionBuilderPlugin A Swift Package Manager command which builds a Github Actions workflow for the current package. By default the workflow file will

Elegant Chaos 4 Jul 20, 2022
Swift-HorizontalPickerView - Customizable horizontal picker view component written in Swift for UIKit/iOS

Horizontal Picker View Customizable horizontal picker view component written in

Afraz Siddiqui 8 Aug 1, 2022
Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. (Pure Swift, Supports Linux)

SwiftFoundation Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. Goals Provide a cross-platform in

null 620 Oct 11, 2022
SnippetsLibrary - Code snippets library for SwiftUI Devs.

SnippetsLibrary is a helpful tool for SwiftUI developers to help with their daily coding life. SnippetsLibrary contains all the needed code snippets for you to view, edit, or add more and more. This will make your daily work easier and faster.

Christopher Lowiec 41 Jan 2, 2023