forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ios]make the screenIfViewLoaded and windowSceneIfLoaded helpers reus…
…able (flutter#44303) The existing `screenIfViewLoaded` and `windowSceneIfLoaded` functions are private helpers of `FlutterViewController` class. This PR moves the logic to a category of the `UIViewController`, so it can be reused for any `UIViewController`s. *List which issues are fixed by this PR. You must list at least one issue.* flutter#43972 (comment) *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
- Loading branch information
1 parent
9522ce9
commit 26b9d3b
Showing
10 changed files
with
174 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_UIVIEWCONTROLLER_FLUTTERSCREENANDSCENEIFLOADED_H_ | ||
#define FLUTTER_UIVIEWCONTROLLER_FLUTTERSCREENANDSCENEIFLOADED_H_ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface UIViewController (FlutterScreenAndSceneIfLoaded) | ||
|
||
/// Returns a UIWindowScene if the UIViewController's view is loaded, and nil otherwise. | ||
- (UIWindowScene*)flutterWindowSceneIfViewLoaded API_AVAILABLE(ios(13.0)); | ||
|
||
/// Before iOS 13, returns the main screen; After iOS 13, returns the screen the UIViewController is | ||
/// attached to if its view is loaded, and nil otherwise. | ||
- (UIScreen*)flutterScreenIfViewLoaded; | ||
|
||
@end | ||
|
||
#endif // FLUTTER_UIVIEWCONTROLLER_FLUTTERSCREENANDSCENEIFLOADED_H_ |
Oops, something went wrong.