简体   繁体   中英

Get moment when view is dismissed

I am trying to implement a custom camera on a view that has both the camera and a section for the user to add comment. So far so good, but what I want is to get the moment when this view is dismissed and goes back to the previous view (something like the imagePicker(didFinishPickingImage)) and also pass the taken picture and comment as parameters. I think I should implement a protocol but I have no idea where to start.

You can use this method for dismissing the view controller:

- (void)dismissViewControllerAnimated:(BOOL)flag
                           completion:(void (^)(void))completion

If you set the flag to YES, you will see the animation of view getting dismissed. If you set the flag to NO, the view will be dismissed right away, and you can do whatever you want in the completiton block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM