HomeiOS DevelopmentSwiftUI Affirmation Dialog in iOS 26+

SwiftUI Affirmation Dialog in iOS 26+


I am making an attempt to provides a affirmation dialog in my app that comes up from the underside of the display screen. That is attainable in iOS 18 with a .confirmationDialog(), however once I construct the identical code for iOS 26 I get a unique consequence. I have not discovered something in SwiftUI’s documentation about this transformation. Is it attainable to alter the code to get the looks from iOS 18 on iOS 26?

import SwiftUI

struct ContentView: View {
    @State personal var dialogShowing: Bool = false
    var physique: some View {
        VStack {
            Button("Press me") {
                dialogShowing = true
            }
        }
        .confirmationDialog("Choices", isPresented: dialogShowing) {
            Button("Possibility A"){}
            Button("Possibility B"){}
        }
    }
}

iOS 18

SwiftUI Affirmation Dialog in iOS 26+

iOS 26

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments