Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | List of all members
UIViewController(FlutterScreenAndSceneIfLoaded) Category Reference

#include <UIViewController+FlutterScreenAndSceneIfLoaded.h>

Instance Methods

(ios(13.0) - API_AVAILABLE
 Returns a UIWindowScene if the UIViewController's view is loaded, and nil otherwise.
 
(UIScreen *) - flutterScreenIfViewLoaded
 
(UIWindowScene *) - flutterWindowSceneIfViewLoaded [implementation]
 

Detailed Description

Definition at line 10 of file UIViewController+FlutterScreenAndSceneIfLoaded.h.

Method Documentation

◆ API_AVAILABLE

- (ios(13.0) API_AVAILABLE

Returns a UIWindowScene if the UIViewController's view is loaded, and nil otherwise.

◆ flutterScreenIfViewLoaded

- (UIScreen *) flutterScreenIfViewLoaded

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.

Definition at line 10 of file UIViewController+FlutterScreenAndSceneIfLoaded.mm.

22 {
23 if (@available(iOS 13.0, *)) {
24 if (self.viewIfLoaded == nil) {
25 FML_LOG(WARNING) << "Trying to access the screen before the view is loaded.";
26 return nil;
27 }
28 return [self flutterWindowSceneIfViewLoaded].screen;
29 }
30 return UIScreen.mainScreen;
31}
#define FML_LOG(severity)
Definition logging.h:82

◆ flutterWindowSceneIfViewLoaded

- (UIWindowScene *) flutterWindowSceneIfViewLoaded
implementation

Definition at line 10 of file UIViewController+FlutterScreenAndSceneIfLoaded.mm.

14 {
15 if (self.viewIfLoaded == nil) {
16 FML_LOG(WARNING) << "Trying to access the window scene before the view is loaded.";
17 return nil;
18 }
19 return self.viewIfLoaded.window.windowScene;
20}

The documentation for this category was generated from the following files: