简体   繁体   English

获得取消视野的时刻

[英]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. 到目前为止,一切都很好,但是我想要的是获得关闭该视图并回到上一个视图的时间(类似于imagePicker(didFinishPickingImage)),并同时将拍摄的图片和注释作为参数传递。 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. 如果将标志设置为YES,则将看到视图动画被关闭。 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. 如果将标志设置为NO,则视图将立即关闭,并且您可以在完成块中执行任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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