The parent class A has a subview B and that subview has another subview C, this is what i want to hide or apply code to (C)
How ?
B is the third subview of A and C is the second subview of B.
They’re like this:
|A
||B “UIView”
||B “UIView”
||B "UIView"
|||C
|||C (i want to access this)
|||C
I already tried
%hook A
-(void)layoutSubviews {
for (C *view in subviews[2].subviews)
%orig;
view.hidden = YES;
%end
but no luck.
The one way I'm thinking of is just doing
subviews[0].subviews[0]...until you get the view you want. Second if you would have to apply code more than once, I'd recommend that you assign a tag to that view once and then just do [UIView viewWithTag:xx], it's much safer.But in most cases, at least in my projects, there is a shortcut, like some delegate or reference to that directly. Just show the FlexFlipboard Browser and search through everything.