14 questions
0
votes
2
answers
550
views
Why does the ShareLink not open a share sheet? (iOS 17.4)
I have a problem: I'm trying to open a share sheet from an alert, but the share sheet just does not open.
import SwiftUI
struct DocumentView: View {
// ...
@State private var newShare: ...
0
votes
1
answer
188
views
SwiftUI Alert With Countdown - How to Dynamically Update Variable Used in Alert
In my SwiftUI view below, I would like my alert to update with the countdown variable which controls whether or not the Proceed button is active & also shows up in the text of the alert itself.
...
1
vote
1
answer
80
views
Cannot convert value of type 'AlertViewPOP' to closure result type 'Alert'
.alert(isPresented: self.$addANoteAlert) {
AlertViewPOP(
isPresented: self.$addANoteAlert,
title: "Alert Title",
message: "This is a message.",
...
1
vote
0
answers
97
views
SwiftUI Alert setting presentation condition true in it's button action closure not showing the alert again
So the thing I want to do is that I have an api call if it fails I show an alert with message, OK button and Retry Button.
Everything is working good but when I do retry it don't shows the alert again ...
0
votes
0
answers
345
views
SwiftUI: Custom .sheet modifier need to attach to top most window of app instead of View
I am aware about the importance of orders of modifiers in SwiftUI.
SwiftUI provides 2 special modifier interms of .alert(...) & .sheet(...). If these modifiers is attached from any down hierarchy ...
3
votes
1
answer
917
views
SwiftUI: Alert that does not close when clicking on button
I'm new to SwiftUI and I'm trying to display an alert that does only close on some conditions but not on every click on its buttons.
Is that possible or does it strike against the concept of alerts?
...
0
votes
1
answer
290
views
SwiftUI alert is not displaying when navigating to screen second time
I have one application in which i am making api call, in this application i want to display error if API does not return the response. When i navigate first time to the screen, it displays alert ...
1
vote
1
answer
730
views
sheet can not be dismissed after an alert is displayed
I’m trying to show alerts in a sheet in SwiftUI. I have Cancel and Save buttons on the sheet and both of them are dismissed after the action is done.If there is an error on saving, an alert is pop ...
0
votes
1
answer
522
views
Swift - Thread 1: EXC_BAD_INSTRUCTION when deleting object from Coredata
I'm trying to delete an object from Coredata, and I sometimes get the error Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0), and my app crashes, when I delete an object. The console ...
7
votes
2
answers
3k
views
SwiftUI - show Alert from Button inside of ToolbarItem
I want to do something similar to the code below, where it shows an alert when a user taps a navigation bar item button. However the code below doesn't work, the alerts do not display.
I can't add the ...
-1
votes
1
answer
1k
views
presenting a confirm alert after an alert with swiftui not working
i'm trying to show a confirmation alert after you press the "Confirm" button on the first alert.
Idea: You press a button and an alert pops up that asks you to cancel or confirm the action. ...
4
votes
1
answer
5k
views
Create an Alert with just one action button
I want an Alert with one button that runs some code. I do not want there to be a cancel button. I've only seen a way to have two buttons, with primaryButton and secondaryButton. Is there a way to do ...
34
votes
5
answers
18k
views
Issue with SwiftUI displaying Alert – Will not display alert box
I have the following code:
@State private var signoutAlert = false
var body: some View {
Button(action: {
self.signoutAlert = true
print("signout button ...
5
votes
2
answers
8k
views
How to present an Alert in SwiftUI with no buttons
I have a situation where I would like to recreate previous UIKit logic by displaying an Alert during a long running operation that the user cannot interact with.
Previously in UIKit, it would be this ...