swipeBack in swiftui
- Go to File > Swift Packages > Add package dependency
- Add it by pasting this link
https://github.com/jmseb3/swipeBack.git
- Select the Version you want to add, the Branch or even the single Commit
import SwipeBack
import SwiftUI
import SwipeBack
struct ContentView: View {
@State var text = "Hello, world!"
var body: some View {
VStack(alignment: .center) {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text(text)
Button("retry") {
text = "Hello, world!"
}
}
.frame(maxWidth: .infinity,maxHeight: .infinity)
.modifier(
SwipeBack(
option: SwipeBackOption(
maxMove: 40,
maxMoveY: 7,
confirmAction: {
text = "back action confirm"
})))
}
}