Skip to content

Instantly share code, notes, and snippets.

@Alex13832
Last active December 5, 2020 11:52
Show Gist options
  • Save Alex13832/84625453a622fee836408a712f07f0cd to your computer and use it in GitHub Desktop.
Save Alex13832/84625453a622fee836408a712f07f0cd to your computer and use it in GitHub Desktop.

Action sheet SwiftUI

var body: some View {
    VStack {
        // ...
    }
    .padding()
    .actionSheet(isPresented: $actionSheetVisible) { () -> ActionSheet in
        ActionSheet(
            title:Text("\(userData.disease_label)"),
            message: Text("Consider consulting a physician"),
            buttons: [
                .default(Text("OK"), action: {}),
                .destructive(Text("Cancel"), action: {})
            ])
    }
}

aciton_sheet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment