LIST THE TAG OF SUBVIEWS WHICH ARE VISIBLE IN A UIVIEW

Felix Pickles

Total Post:24

Points:168
Posted by  Felix Pickles
 655  View(s)
Ratings:
Rate this:

I have UIView, Initially i will have 4 subview, in runtime. my code will hide to 2 view, so i need the tag values of remaining two view which are visible, is it possible.

Please help me.

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: List the tag of Subviews which are visible in a UIview

    Yes, its possible here is your problem’s solution:

    for (UIView *subview in self.view.subviews) {

        if ([subview isKindOfClass:[UIView class]]) {

            if (!subview.isHidden) {

                NSLog(@"%i", subview.tag);

            }

        }

    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!