views:

49

answers:

1

When revealing a new view, what are the differences between these two and when would you use each?

Also, what's the right way to nest views. for example, I have a UIImageview that animates onto my view and it has a button on it. I want to put that image and the button in their own view, then simply animate the view and have both handled simultaneously.

Thanks!

A: 

For the first question :

presentModalView is you show another viewcontroller (called modalViewController) to get some data, temporary view... (more about ModalViewController here) . Generally, it is another view and can hide your original view

addSubview: you add another view in your current screen, you don't show another view. Which means you are still in your current viewController.

For the second question: I will go for presentModalViewController here. You can create another UIViewController contains a UIImageView and 2 buttons then you can just present it

vodkhang