SlideDecisionControl is a SwiftUI control designed to help prevent accidental actions by requiring a deliberate slide to confirm or reject decisions. It ensures intentional choices and provides a smooth user experience.
- Prevents accidental taps by requiring a sliding action.
- Use explicit gestures for critical operations.
- Customizable UI to fit various design needs.
Check out how SlideDecisionControl works in action:
To install via Swift Package Manager, add the following line to your Package.swift
file:
dependencies: [
.package(url: "https://github.com/EyenSoftware/SlideDecisionControl.git", from: "1.0.0")
]
Alternatively, in Xcode:
- Go to File > Add Packages...
- Enter the repository URL:
https://github.com/EyenSoftware/SlideDecisionControl.git
- Select the latest version and add it to your project.
import SlideDecisionControl
struct ContentView: View {
var body: some View {
SlideDecisionControl {
action in
}
.padding()
}
}
import SlideDecisionControl
struct ContentView: View {
var body: some View {
SlideDecisionControl(
imageAccept: .system(name: "heart"),
textAccept: "Slide to Love",
imageMiddle: .system(name: "bubble"),
imageReject: .system(name: "xmark.circle"),
textReject: "Slide to Hate"
) { _ in
}
.padding()
}
}
- iOS 17.0+
- Swift 5.5+
SlideDecisionControl is available under the MIT license. See the LICENSE file for more information.
Contributions are welcome! If you'd like to contribute, please fork the repository and submit a pull request.
We’d love to hear your thoughts! Feel free to open an issue for suggestions, bugs, or improvements.
Made with ❤️ by Eyen