Skip to content

Commit 817eb67

Browse files
committed
Adding a workaround in -rootView for DCIntrospect.
I see on github there have been issues with this -rootView method, similiar to what I encountered. There’s an open issue on this, and I added my voice to it, regarding my particular case: #57
1 parent fd49004 commit 817eb67

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

WYPopoverController/WYPopoverController.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,14 @@ - (UIView *)rootView
14171417

14181418
//WY_LOG(@"rootView.subview[%i] = %@", i, view);
14191419

1420-
if (!view.isHidden)
1420+
// Hsoi 2014-01-24 - If using DCIntrospect, it inserts a DCTextView into the window's subviews
1421+
// and breaks WYPopoverController's assumptions about the view hierarchy. It'd probably be better
1422+
// if WYPopoverController was more explicit about exactly what it wanted here instead of assuming
1423+
// the "last visible" subview. But as I cannot be 100% sure of the original author's intent, I'll
1424+
// instead work around our use of DCIntrospect by saying if that class exists, skip it because it
1425+
// certainly isn't the UIView we want.
1426+
Class DCTextView = NSClassFromString(@"DCTextView");
1427+
if (!view.isHidden && (!DCTextView || (DCTextView && ![view isKindOfClass:DCTextView])) )
14211428
{
14221429
result = view;
14231430
break;

0 commit comments

Comments
 (0)