Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 1.51 KB

README.md

File metadata and controls

60 lines (44 loc) · 1.51 KB

DGOverFullScreenView

SwiftUI View that can be dismissed by dragging

ezgif com-video-to-gif-converter

Installation

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding DGOverFullScreenView as a dependency is as easy as adding it to the dependencies value of your Package.swift or the Package list in Xcode.

dependencies: [
   .package(url: "https://github.com/donggyushin/DGOverFullScreenView", .upToNextMajor(from: "1.0.0"))
]

Normally you'll want to depend on the DGOverFullScreenView target:

.product(name: "DGOverFullScreenView", package: "DGOverFullScreenView")

Usage

import SwiftUI
import DGOverFullScreenView

struct ContentView: View {

    @State private var isPresenting: Bool = false

    var body: some View {
        VStack {

            Text("Parent View")

            Button("Show") {
                withAnimation {
                    isPresenting = true
                }
            }
        }
        .overFullScreen(isPresented: $isPresenting) {
            ZStack {
                Color.black
                Button("Dismiss") {
                    withAnimation {
                        isPresenting = false
                    }
                }
            }
        }
    }
}