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 22 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 }

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