File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,18 @@ public struct UIKitIntrospectionView<TargetViewType: UIView>: UIViewRepresentabl
67
67
/// `makeUIView`, so we need to call the handler again to allow re-customization
68
68
/// based on the newest state.
69
69
public func updateUIView(
70
- _ uiView : IntrospectionUIView ,
70
+ _ view : IntrospectionUIView ,
71
71
context: UIViewRepresentableContext < UIKitIntrospectionView >
72
72
) {
73
- uiView. moveToWindowHandler ? ( )
73
+ guard let targetView = self . selector ( view) else {
74
+ return
75
+ }
76
+ self . customize ( targetView)
74
77
}
75
78
76
79
/// Avoid memory leaks.
77
- public static func dismantleUIView( _ uiView : IntrospectionUIView , coordinator: ( ) ) {
78
- uiView . moveToWindowHandler = nil
80
+ public static func dismantleUIView( _ view : IntrospectionUIView , coordinator: ( ) ) {
81
+ view . moveToWindowHandler = nil
79
82
}
80
83
}
81
84
#endif
Original file line number Diff line number Diff line change @@ -59,7 +59,10 @@ public struct UIKitIntrospectionViewController<TargetViewControllerType: UIViewC
59
59
_ viewController: IntrospectionUIViewController ,
60
60
context: UIViewControllerRepresentableContext < UIKitIntrospectionViewController >
61
61
) {
62
- ( viewController. view as? IntrospectionUIView ) ? . moveToWindowHandler ? ( )
62
+ guard let targetView = self . selector ( viewController) else {
63
+ return
64
+ }
65
+ self . customize ( targetView)
63
66
}
64
67
65
68
/// Avoid memory leaks.
You can’t perform that action at this time.
0 commit comments