{"repo":"Dean151/ButtonKit","free":true,"listed":false,"github":"https://github.com/Dean151/ButtonKit","clone":"git clone https://github.com/Dean151/ButtonKit.git","description":"Asynchronous and Throwable button implementation for SwiftUI, with animations and progress tracking","language":"Swift","stars":531,"topics":["button","swiftui","activity-indicator","async-await","ios","loading","macos","progress","swift","swift-concurrency"],"license":"MIT","category":"mobile-apps","readme_excerpt":"ButtonKit ButtonKit provides a new a SwiftUI Button replacement to deal with throwable and asynchronous actions. By default, SwiftUI Button only accept a closure. With ButtonKit, you'll have access to an AsyncButton view, accepting a () async throws - Void closure. Requirements - Swift 6.0+ (Xcode 16.0+) - iOS 15+, iPadOS 15+, tvOS 15+, watchOS 8+, macOS 12+, visionOS 1+ Installation Install using Swift Package Manager And import it: Usage Throwable Use it as any SwiftUI button, but throw if you want in the closure: You can monitor when one of your buttons fails When the button closure throws, the button will shake by default No preview .throwableButtonStyle(.shake) .throwableButtonStyle(.symbolEffect(.wiggle)) You can still disable it by passing .none to throwableButtonStyle: You can also bring your own behavior using the ThrowableButtonStyle protocol. In ThrowableButtonStyle, you can implement makeLabel , makeButton or both to alter the button look and behavior. Then, use it: Asynchronous Use it as any SwiftUI button, but the closure will support both try and await. When the process is in progress, another button press will not result in a new Task being issued. But the button is still enabled and hittable. You can disable the button on loading using disabledWhenLoading modifier. You can also disable hitTesting when loading with allowsHitTestingWhenLoading modifier. Access and react to the underlying button state using onStateChange parameter. You can also monitor more than","default_branch":null,"files":null,"tree":[],"storefront":"/r/Dean151","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Dean151/ButtonKit/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}