Skip to content

littleossa/PopUpDialogViewSample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PopUpDialogViewSample

SwiftUI Pop-up Dialog View Sample

Demo

popup-dialog-view

Usage

This is example.

import SwiftUI

struct ContentView: View {
    
    @State private var shouldPresentPopUpDialog = false
    
    var body: some View {
        ZStack {
            Button {
                withAnimation {
                    shouldPresentPopUpDialog = true
                }
            } label: {
                Text("Present Pop-up Dialog")
            }
            
            if shouldPresentPopUpDialog {
                PopUpDialogView(isPresented: $shouldPresentPopUpDialog) {
                    Face()
                }
            }
        }
    }
}

Put your view in the PopUpDialogView as a content.

PopUpDialogView(isPresented: $shouldPresentPopUpDialog) {
    Face()
}

Rock'n'roll!

About

SwiftUI Pop-up Dialog View Sample

Topics

Resources

Stars

Watchers

Forks

Languages