firebase / FirebaseUI-iOS

iOS UI bindings for Firebase.
Apache License 2.0
1.5k stars 467 forks source link

fix: respects DarkMode in CountryTableView #1147

Closed matheusmatos closed 8 months ago

matheusmatos commented 1 year ago

Hello guys, this simple PR fixes the issue https://github.com/firebase/FirebaseUI-iOS/issues/1013.

RaimundasSakalauskas commented 1 year ago

Any estimation when this might get merged and shipped? Our users keep complaining about unusable country selector in dark mode.

tehsven commented 11 months ago

Hey @matheusmatos can you please hit the Merge button? This continues to be an issue and we're having to workaround it with some pretty hacky code.

tehsven commented 11 months ago

Or maybe @morganchen12 can merge this?

vinhhoangbepos commented 8 months ago

@morganchen12 @matheusmatos Can you please merge this?

RaimundasSakalauskas commented 8 months ago

Since google team seems to be ignoring this entirely, here's the workaround that we have to make this work:

private var phoneAuthUIBugTask: Task<Void, Error>?
...
            if button.provider.providerID == PhoneAuthProviderID {
                phoneAuthUIBugTask = Task { @MainActor [weak self] in
                    while let self, self.presentedViewController != nil {
                        if let nvc = self.presentedViewController as? UINavigationController,
                           nvc.viewControllers.count >= 2, case let vc = nvc.viewControllers[1],
                           vc.view.subviews.count >= 1, let tableView = vc.view.subviews[0] as? UITableView {
                            tableView.backgroundColor = .systemBackground //fix dark mode
                            tableView.tableHeaderView = nil //remove search view, because it's broken
                        }

                        //10x per second
                        try await Task.sleep(nanoseconds: 100_000_000)
                    }
                }
            }
...

I start the task when displaying the phone auth and cancel the task in func authUI(_ authUI: FUIAuth, didSignInWith authDataResult: AuthDataResult?, error: Error?)

morganchen12 commented 8 months ago

Hey everyone, apologies for the slow merge. This will be out in the next release.