Skip to content

Commit

Permalink
💫 Update: PresentationControllerMetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Sep 27, 2024
1 parent 6fffcf9 commit 23963eb
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion ios/Temp/PresentationControllerMetrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 23963eb

Please sign in to comment.