Reputation: 57
I have a UIScrollView which has added viewController.view .How to get subview in scroll view.
Everyone Any ideas?
Thanks
Upvotes: 1
Views: 3844
Reputation: 19418
if you want to add your view in scroll view then:
[yourScrollView addSubview:yourSubView];
and if you want to get that view then you can :
if ([yourScrollView subviews])
{
for (UIView *subview in [yourScrollView subviews])
{
if ([subview isKindOfClass:yourClassName])
{
//Code
}
}
}
Upvotes: 5
Reputation: 10393
[yourscrollview subviews]; // This gives you all subviews added
If you want to add subviews then you can use the -addSubview method.
You can get all this info from the documentation.
Upvotes: 1
Reputation: 118681
Since UIScrollView
inherits from UIView
, you can use -addSubview:
.
Upvotes: 1