---
title: "List the tag of Subviews which are visible in a UIview"  
description: "List the tag of Subviews which are visible in a UIview"  
author: "Anonymous User"  
published: 2015-08-04  
updated: 2015-08-04  
canonical: https://www.mindstick.com/forum/33391/list-the-tag-of-subviews-which-are-visible-in-a-uiview  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# List the tag of Subviews which are visible in a UIview

I have UIView, Initially i will have 4 subview, in runtime. my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) will hide to 2 [view](https://yourviews.mindstick.com/view/84701/layoffs-in-google-india-2023-view), so i need the tag [values](https://www.mindstick.com/forum/327/sum-textbox-values) of remaining two view which are visible, is it possible.

Please help me.

## Replies

### Reply by Tarun Kumar

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);        }    }}
```


---

Original Source: https://www.mindstick.com/forum/33391/list-the-tag-of-subviews-which-are-visible-in-a-uiview

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
