From 23963ebd132d9d054b7f8de4749b5025ddb43a57 Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Fri, 27 Sep 2024 16:55:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Update:=20`PresentationControlle?= =?UTF-8?q?rMetrics`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Temp/PresentationControllerMetrics.swift | 29 +++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/ios/Temp/PresentationControllerMetrics.swift b/ios/Temp/PresentationControllerMetrics.swift index d6b4cdfb..d79b6f5f 100644 --- a/ios/Temp/PresentationControllerMetrics.swift +++ b/ios/Temp/PresentationControllerMetrics.swift @@ -9,7 +9,9 @@ import UIKit import DGSwiftUtilities -public struct PresentationControllerMetrics: Encodable { +public struct PresentationControllerMetrics: DictionaryRepresentationSynthesizing { + + public var instanceID: String; public var frameOfPresentedViewInContainerView: CGRect; public var preferredContentSize: CGSize; @@ -22,7 +24,32 @@ public struct PresentationControllerMetrics: Encodable { public var shouldPresentInFullscreen: Bool; public var shouldRemovePresentersView: Bool; + // MARK: - Init + // ------------ + + public init( + instanceID: String, + frameOfPresentedViewInContainerView: CGRect, + preferredContentSize: CGSize, + presentedViewFrame: CGRect?, + containerViewFrame: CGRect?, + adaptivePresentationStyle: String, + shouldPresentInFullscreen: Bool, + shouldRemovePresentersView: Bool + ) { + self.instanceID = instanceID; + self.frameOfPresentedViewInContainerView = frameOfPresentedViewInContainerView; + self.preferredContentSize = preferredContentSize; + self.presentedViewFrame = presentedViewFrame; + self.containerViewFrame = containerViewFrame; + self.adaptivePresentationStyle = adaptivePresentationStyle; + self.shouldPresentInFullscreen = shouldPresentInFullscreen; + self.shouldRemovePresentersView = shouldRemovePresentersView; + }; + public init(from presentationController: UIPresentationController) { + self.instanceID = presentationController.synthesizedStringID; + self.frameOfPresentedViewInContainerView = presentationController.frameOfPresentedViewInContainerView;