Home > OS >  how can i navigate from UIAlertController to a new screen (swiftUI)
how can i navigate from UIAlertController to a new screen (swiftUI)

Time:06-24

how can I navigate from UIAlertController(UIKit) to a new view(SwiftUi) due the the reason the swiftui alert can't use a textfield I used UIKit(UIalertcontroller) and I want to open a new screen after I click the submit button

I have tried:

    var passwordField: UITextField? = nil

    let alert = UIAlertController(title: "Admin Passcode", message: "Please enter an administrator password", preferredStyle: .alert)

    alert.addAction(UIAlertAction(title: "Submit", style: .default, handler: { Action in
        if let passwordField = passwordField {
            if passwordField.text == Constants.AdminPwd {
                print("Wow           
  • Related