Skip to content

Discontinuity from UIKit interface #1327

@visskiss

Description

@visskiss

Not to rain on anyone's parade, but I went to upgrade to 16.0 from 15.1 and I found it to be too much of a headache.

I use the UIViewControllerRepresentable to embed the entire flow wherever I want. This is how simple this used to be:

  import SwiftUI
  import Firebase
  import FirebaseAuthUI
  import FirebaseEmailAuthUI
  import FirebaseOAuthUI
  
  struct LoginView: View {
      
      var body: some View {
          VStack {
              HStack {
                  Spacer()
                  DismissButton()
              }
              FirebaseAuthUIRepresentable()
              Spacer()
          }
          .background(Color(.loginSheetBackground))
      }
  }
  struct FirebaseAuthUIRepresentable: UIViewControllerRepresentable {
      
      func makeUIViewController(context: Context) -> UINavigationController {
          let authUI = FUIAuth.defaultAuthUI()!
          let emailProvider = FUIEmailAuth()
          let providers: [FUIAuthProvider] = [
              emailProvider,
              FUIOAuth.appleAuthProvider()
          ]
          authUI.providers = providers
          authUI.shouldHideCancelButton = true
          let authViewController = authUI.authViewController()
          authUI.delegate = context.coordinator
          
          return authViewController
      }
      
      func updateUIViewController(_ uiViewController: UINavigationController, context: Context) {}
     
      func makeCoordinator() -> Coordinator {
          Coordinator(self)
      }
      
      class Coordinator: NSObject, FUIAuthDelegate {
          var parent: FirebaseAuthUIRepresentable
          
          init(_ parent: FirebaseAuthUIRepresentable) {
              self.parent = parent
          }
      }
  }
  

However, "upgrading" is not possible with the current authswiftui. It requires jumping through hoops and even gemini has no clue how to do it. I gave up and stayed at 15.1

So, can you please make the swiftui flow embeddable in ANY VIEW. I don't want a global var or an environment var with a toggle switch. I just want the ui to handle logging in and then I'll take over the Firebase Auth.

Thanks for listening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions