Questions tagged [swiftui-actionsheet]
10 questions
6
votes
1 answer
How to navigate out of a ActionSheet?
how to navigate out of a ActionSheet where I can only Pass a Text but not a NavigationLink?
Sample Code:
struct DemoActionSheetNavi: View {
@State private var showingSheet = false
var body: some View {
NavigationView {
…

gurehbgui
- 14,236
- 32
- 106
- 178
4
votes
3 answers
SwiftUI - Dynamic list of buttons in ActionSheet
I need to generate a dynamic list of buttons in an ActionSheet. Say I have an array of options ["Option1", "Option2"], how can I achieve this?
.actionSheet(isPresented: self.$showSheet, content: {
ActionSheet(title: Text("Select an option"),…

Ken Chung
- 53
- 1
- 6
2
votes
1 answer
SwiftUI ActionSheet disabled button
This seems like maybe a simple question, but I'm looking for a way to make one (or more, I suppose) buttons in an ActionSheet in SwiftUI to be disabled. For example, if something is illegal based on the state of the app, I don't want to let the user…

Hoopes
- 3,943
- 4
- 44
- 60
2
votes
1 answer
SwiftUI ActionSheet how can i change cancel color
I have an action sheet that has 5 elements and a cancel button. I am trying to make the cancel button color red but it is not working. I have seen this one SwiftUI ActionSheet different color for each action. The destructive button style makes the…

user1591668
- 2,591
- 5
- 41
- 84
2
votes
1 answer
SwiftUI ActionSheet Picker
I'm trying to create in SwiftUI an action sheet that appears after pressing a button and allow the user to select and return an item throught a picker (like this https://i.stack.imgur.com/rJn8I.jpg).
Any hint on how to do it?
Thanks

Fabrizio
- 55
- 1
- 5
1
vote
1 answer
Add a different modifier to each Action Sheet button
This is probably quite a simple question, but I can't find an answer.
I'm trying to build an ActionSheet with two buttons (as well as a cancel button):
Button "Select from Gallery" opens an imagePicker with sourceType set to .photoLibrary.
Button…

FPL
- 456
- 4
- 21
1
vote
1 answer
SwiftUI ActionSheet does not dismiss when timer is running
I have the following simple SwiftUI setup. A timer that is running and updating a Text. If the timer is not running (stopped or paused) I can easily show an ActionSheet (by tapping on Actions) and dismiss it by choosing either "Cancel" or "Action 1"…

Dogahe
- 1,380
- 2
- 20
- 50
0
votes
0 answers
SwiftUI - Cannot share image to third-party app using action sheet
I am using SwiftUI, and I am trying to use share sheet to share image from my app to other apps. I found that my image could send to every native app in iPhone such as message, email and the image could be saved to local picture app, but for any…

cc nn
- 115
- 1
- 1
- 7
0
votes
0 answers
Not able to update variables within actionSheet
I'm finding that when using a variable within an .actionSheet the variables are not updating after the initial engagement. I've tried using this in the main view and the extracted view and the behavior is exactly the same. In the picture below I…

Robert
- 809
- 3
- 10
- 19
0
votes
1 answer
SwiftUI: UIAlertController ActionSheet is full screen
I am trying to implement a check marked action sheet in a SwiftUI View. I am using a
UIViewControllerRepresentable to create a UIAlertController
struct WhatsAppAlertController: UIViewControllerRepresentable {
let viewModel: PropViewModel
…

Cam Scen
- 592
- 1
- 4
- 9