Edward Anthony Edward Anthony - 3 months ago 12
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 ?


And...

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


what is in superview?

Answer

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