Swiftpack.co - Tunous/DebouncedOnChange as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Tunous.
Tunous/DebouncedOnChange 1.0.0
SwiftUI onChange View extension with debounce time
⭐️ 0
🕓 3 weeks ago
iOS macOS
.package(url: "https://github.com/Tunous/DebouncedOnChange.git", from: "1.0.0")

DebouncedOnChange

A SwiftUI onChange view modifier with additional debounce time.

Usage

import SwiftUI
import DebouncedOnChange

struct ExampleView: View {
    @State private var text = ""

    var body: some View {
        TextField("Text", text: $text)
            .onChange(of: text, debounceTime: 2) { newValue in
                // Action executed each time 2 seconds pass since change of text property
            }
    }
}

Installation

Swift Package Manager

Add the following to the dependencies array in your "Package.swift" file:

.package(url: "https://github.com/Tunous/DebouncedOnChange.git", .upToNextMajor(from: "1.0.0"))

Or add https://github.com/Tunous/DebouncedOnChange.git, to the list of Swift packages for any project in Xcode.

GitHub

link
Stars: 0
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Initial release
3 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics