Flutter iOS Embedder
UIViewController(FlutterScreenAndSceneIfLoaded) Category Reference

#import <UIViewController+FlutterScreenAndSceneIfLoaded.h>

Instance Methods

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

Detailed Description

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 19 of file UIViewController+FlutterScreenAndSceneIfLoaded.mm.

19  {
20  if (@available(iOS 13.0, *)) {
21  if (self.viewIfLoaded == nil) {
22  FML_LOG(WARNING) << "Trying to access the screen before the view is loaded.";
23  return nil;
24  }
25  return [self flutterWindowSceneIfViewLoaded].screen;
26  }
27  return UIScreen.mainScreen;
28 }

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