From 9360c9c3206d745525f90471c50788139ac014d4 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 15 Feb 2023 20:31:04 +0000 Subject: [PATCH 1/3] wip --- Introspect/UIKitIntrospectionViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Introspect/UIKitIntrospectionViewController.swift b/Introspect/UIKitIntrospectionViewController.swift index 4d8f1d34..30d49901 100644 --- a/Introspect/UIKitIntrospectionViewController.swift +++ b/Introspect/UIKitIntrospectionViewController.swift @@ -40,8 +40,8 @@ public struct UIKitIntrospectionViewController Date: Wed, 15 Feb 2023 20:33:04 +0000 Subject: [PATCH 2/3] wip --- Introspect/UIKitIntrospectionViewController.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Introspect/UIKitIntrospectionViewController.swift b/Introspect/UIKitIntrospectionViewController.swift index 30d49901..a0e20d7b 100644 --- a/Introspect/UIKitIntrospectionViewController.swift +++ b/Introspect/UIKitIntrospectionViewController.swift @@ -40,8 +40,8 @@ public struct UIKitIntrospectionViewController ) { - (viewController.view as? IntrospectionUIView)?.moveToWindowHandler?() + guard let targetView = self.selector(viewController) else { + return + } + self.customize(targetView) } /// Avoid memory leaks. From 90b4ca7e135105e610afaef7234df92d2ec72ae5 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 15 Feb 2023 20:34:51 +0000 Subject: [PATCH 3/3] wip --- Introspect/UIKitIntrospectionView.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Introspect/UIKitIntrospectionView.swift b/Introspect/UIKitIntrospectionView.swift index 236abae9..9d9765fe 100644 --- a/Introspect/UIKitIntrospectionView.swift +++ b/Introspect/UIKitIntrospectionView.swift @@ -67,15 +67,18 @@ public struct UIKitIntrospectionView: UIViewRepresentabl /// `makeUIView`, so we need to call the handler again to allow re-customization /// based on the newest state. public func updateUIView( - _ uiView: IntrospectionUIView, + _ view: IntrospectionUIView, context: UIViewRepresentableContext ) { - uiView.moveToWindowHandler?() + guard let targetView = self.selector(view) else { + return + } + self.customize(targetView) } /// Avoid memory leaks. - public static func dismantleUIView(_ uiView: IntrospectionUIView, coordinator: ()) { - uiView.moveToWindowHandler = nil + public static func dismantleUIView(_ view: IntrospectionUIView, coordinator: ()) { + view.moveToWindowHandler = nil } } #endif