From 25f7f084dba52320513643c391feff191d8d8a38 Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Fri, 27 Sep 2024 16:56:13 +0800 Subject: [PATCH] =?UTF-8?q?=E2=AD=90=EF=B8=8F=20Impl:=20`UIViewController.?= =?UTF-8?q?presentationControllerMetrics`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Temp/UIPresentationController+Helpers.swift | 16 ++++++++++++++++ ios/Temp/UIViewController+ModalHelpers.swift | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 ios/Temp/UIPresentationController+Helpers.swift diff --git a/ios/Temp/UIPresentationController+Helpers.swift b/ios/Temp/UIPresentationController+Helpers.swift new file mode 100644 index 00000000..e3886a67 --- /dev/null +++ b/ios/Temp/UIPresentationController+Helpers.swift @@ -0,0 +1,16 @@ +// +// UIPresentationController+Helpers.swift +// react-native-ios-modal +// +// Created by Dominic Go on 9/27/24. +// + +import UIKit + + +extension UIPresentationController { + + public var presentationControllerMetrics: PresentationControllerMetrics { + .init(from: self); + }; +}; diff --git a/ios/Temp/UIViewController+ModalHelpers.swift b/ios/Temp/UIViewController+ModalHelpers.swift index 328ddfee..c02001bc 100644 --- a/ios/Temp/UIViewController+ModalHelpers.swift +++ b/ios/Temp/UIViewController+ModalHelpers.swift @@ -119,4 +119,7 @@ extension UIViewController { return window.currentModalLevel; }; + public var presentationControllerMetrics: PresentationControllerMetrics? { + self.presentationController?.presentationControllerMetrics; + }; };