Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 903 Bytes

README.md

File metadata and controls

35 lines (29 loc) · 903 Bytes

PopTransition

Track and perform action by doing interactive swipe transition or back button press for SwiftUI.

Usage

struct MyView: View {
    var body: some View {
        ZStack {
            // ...
        }
        .onPopTransition { transitionState in
            switch transitionState {
            case .start(let type):
                print("Start transition with: \(type)")
            case .finish(let type):
                print("Finish transition with: \(type)")
            case .interactiveSwipeChange:
                print("Finger lifted up or moved back to left edge.")
            case .interactiveSwipeCancel:
                print("Interactive swipe transition cancel.")
            }
        }
    }
}

Requirements

License

  • PopTransition is distributed under the MIT License.