Skip to content

feat(core): add util method for fetching active scenes by selector - #16398

Open
daymxn wants to merge 5 commits into
mainfrom
dlr/core-util-scene-method
Open

feat(core): add util method for fetching active scenes by selector#16398
daymxn wants to merge 5 commits into
mainfrom
dlr/core-util-scene-method

Conversation

@daymxn

@daymxn daymxn commented Jul 14, 2026

Copy link
Copy Markdown
Member

Per b/534816940,

This PR adds a common util method to FirebaseCore for finding an active scene that responds to a specific selector.

With our recent scene delegate migration work, we've ran across a few instances where we needed to iterate over the connected scenes in the application and find one that responses to a certain selector.

There's some additional nuance to how we perform this search (ie; with UISceneActivationStateForegroundInactive), which are worth documenting in a central place, and can easily be overlooked.

To avoid this issue, and to practice proper DRY principles, we expose a central method in FirebaseCore that handles this process. Pending scene delegate work PRs should also be updated to take advantage of this method after it's merged.

Tests have also been added for this new util method, and documentation articulating its usage and such have been added as well.

Example usage:

SEL selector = @selector(scene:continueUserActivity:);
UIScene *targetScene = [UIApplication
   fir_findForegroundSceneWithDelegateRespondingToSelector:selector
                                           onApplication:self.mainApplication];
if (targetScene) {
 [targetScene.delegate scene:targetScene continueUserActivity:userActivity];
}      

@daymxn
daymxn requested a review from ncooke3 July 14, 2026 18:50
@daymxn daymxn self-assigned this Jul 14, 2026
@daymxn
daymxn requested a review from a team as a code owner July 14, 2026 18:50
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@danger-firebase-ios

Copy link
Copy Markdown
1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@ncooke3 ncooke3 added this to the Firebase 13 milestone Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants