Skip to content

Commit f2fa168

Browse files
authored
Change deprecated keyWindow to new API (#14048)
1 parent 0006c72 commit f2fa168

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

FirebasePerformance/Sources/Instrumentation/UIKit/FPRUIViewControllerInstrument.m

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,9 @@ void InstrumentViewDidAppear(FPRUIViewControllerInstrument *instrument,
6969

7070
// This has to be called on the main thread and so it's done here instead of in
7171
// FPRScreenTraceTracker.
72-
// TODO(#13067): Replace keyWindow usage (deprecated in iOS and unavailable in visionOS).
73-
#if !defined(TARGET_OS_VISION) || !TARGET_OS_VISION
74-
#pragma clang diagnostic push
75-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
76-
if ([((UIViewController *)_self).view isDescendantOfView:FPRSharedApplication().keyWindow]) {
77-
#pragma clang diagnostic pop
72+
if (FPRSharedApplication() && ((UIViewController *)_self).view.window.keyWindow) {
7873
[[FPRScreenTraceTracker sharedInstance] viewControllerDidAppear:_self];
7974
}
80-
#endif
8175
}];
8276
}
8377

0 commit comments

Comments
 (0)