Reputation: 136
I would like to create a small popup window that appears in front of an existing UIView
. This popup window needs to take text input and have a button on it. This popup window should appear when a UIButton
is pressed.
I'm using a storyboard and am wondering what is the best approach to complete this? Should I just be using another UIView
? If so, how do I go about creating the new view on top of the existing UIView
?
Any guidance would be appreciated.
Thanks.
Upvotes: 0
Views: 491
Reputation: 89519
It can be as simple as adding a new UIView with all the various controls / labels you want in it and put that new view on top of your view controller's main view (this might be considered as a subview).
Then set the new view to an outlet in your view controller and hide it (via the attributes inspector).
When the button is touched, you can programatically set the "popup window" view's ".hidden
" property to "NO
".
Upvotes: 1