Skip to content

jmseb3/swipeBack

Repository files navigation

SwipeBack For Swiftui

swipeBack in swiftui

Installation (SPM)

  1. Go to File > Swift Packages > Add package dependency
  2. Add it by pasting this link https://github.com/jmseb3/swipeBack.git
  3. Select the Version you want to add, the Branch or even the single Commit

How To Use

import

import SwipeBack

add Modifider

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"
        })))
    }
}

Preview

preview

About

swipe back for swiftUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages