Edward Anthony Edward Anthony - 1 year ago 108
iOS Question

( iOS ) What is superview and what is subviews

What is superview and what is subviews?

When I add this code:

[self.view addSubview:self.frontView];
// what does that mean ?


@property (nonatomic, strong) IBOutlet UIImageView *frontView;
[self.frontView superview] != nil // means ?

what is in superview?

Answer Source

superview means a view which holds the another view over it. subviews means the views which are holding/added over a 'View'.

Lets Say. you have a view MyView which has a UIButton(loginButton) over it.So, MyView is superview for that loginButton. loginButton is a subview forMyView`.

For more ,you should start from here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download