使用情节提要时关闭模式的正确方法是什么? [英] What is the proper way to dismiss a modal when using storyboards?

查看:14
本文介绍了使用情节提要时关闭模式的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用情节提要,关闭模式的正确方法是什么?

Using storyboards, what is the proper way to dismiss a modal?

  • 使用 IBAction 并编写代码在单击按钮后关闭?
  • 在单击按钮后使用 segue 并通知父视图控制器?

推荐答案

看这里 关闭呈现的视图控制器 大约一半

当需要关闭呈现的视图控制器时,首选方法是让呈现的视图控制器关闭它.

When it comes time to dismiss a presented view controller, the preferred approach is to let the presenting view controller dismiss it.

因此,您应该使用 IBAction 并编写代码在单击按钮后关闭

So you should use an IBAction and writing code to dismiss after a button click

这篇关于使用情节提要时关闭模式的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆