Any of you knows how can I can get the list of subviews on view?. there is a way to get the list into in array?
NSMutableArray *subviews= .... //all my subviews
Any of you knows how can I can get the list of subviews on view?. there is a way to get the list into in array?
NSMutableArray *subviews= .... //all my subviews
You can do in this way
- (void)listSubviewsOfView:(UIView *)view {
// Get the subviews of the view
NSArray *subviews = [view subviews];
// Return if there are no subviews
if ([subviews count] == 0) return;
for (UIView *subview in subviews) {
NSLog(@"%@", subview);
// List the subviews of subview
[self listSubviewsOfView:subview];
}
}
Please go through this link How to list out all the subviews in a uiviewcontroller in iOS?