How to add a pop up?

i would like a little check mark or something pop up in the middle of the screen when the user presses the done button. I kind of can do it but the biggest problem is the done button is in a table view so simply getting the screen size doesnt work. Thanks


Matthew Warner

Find the Height and width that you want the check mark to be and the position that you want it to appear at (in pixels) then programmatically implement the check mark.

Just use UIAlertView. (iOS 8 and up)

If your view controller is a UITableViewController, you'll need to redo it as a UIViewController so you can add arbitrary subviews. UITableViewControllers don't support that (they only expect one subview, their UITableView).


Add a UIView containing your checkmark image and any decoration (frame, background etc.) to your view controller's view in IB. Position it how you like using layout constraints (e.g. center in superview). Set it to hidden. Make an outlet into your VC. Or you can add the subview in code in viewDidLoad if you prefer.


In code, when you want to show it, set its hidden property to NO. You'll probably want to do some animation instead of just having it appear, but that can be added later once you have it working.

How to add a pop up?
 
 
Q