user3499627
user3499627

Reputation: 63

Dismissing a popover view controller

In the app i have i display popover view when i press an + bottom. I then have the person put in some information and then they need to use a uiimagepickercontroller within the popover view to add a picture to the information. I then need the person to be able to press a done button and have the popover view close. My problem is that in the story board I am using a popover segue to make the view a popover view but to be able to display the uiimagepickercontroller, the view controller is just a regular view controller. I can not seen to find a way to get everything to work and be able to minimize the popover by pressing the button. Currently everything works until i try to press the button to close the view.

Upvotes: 0

Views: 187

Answers (1)

Eric Rowe
Eric Rowe

Reputation: 53

Did you try dismissViewControllerAnimated?

@IBAction func doneButtonTapped(AnyObject) {
    dismissViewControllerAnimated(true, completion: nil)
}

https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/dismissViewControllerAnimated:completion:

Upvotes: 1

Related Questions