ios - 使用部分 curl 显示呈现 View Controller

标签 ios uiviewcontroller uistoryboardsegue

我有一个带有多个文本字段/ TextView 的 View Controller ,并且希望允许用户使用他们在网络上找到的内容填充这些字段。为了做到这一点,我有一个不同的 web View 以模态方式呈现。我的问题是我想使用部分页面 curl 来显示第一个 View Controller (包含任何填充信息)。但是,您不能第二次显示实时 View Controller ,并且新实例不会预先填充文本字段中已放置的任何信息。

似乎我可以来回传递该信息(从第一个实例到第二个 View Controller ,然后将信息复制到第二个实例,然后在我关闭第二个实例时复制回来,等等)但是它似乎应该有更好的方法。

我也可以将 Web View Controller 添加为 subview ,但我错过了部分 curl 的功能,我真的很喜欢。

谢谢!

最佳答案

However, you can't present a live view controller a second time, and the new instance is not pre populated with whatever information was already placed in the textfields.

你不需要每次都创建一个新的 View Controller 。只需将该 View Controller 对象存储为一个实例变量,并且在您的用户完成之前不要释放它。

if (myViewController == nil) {
    myViewController = [UIViewController alloc] init];
}
[self presentViewController:myViewController animated:YES];    

关于ios - 使用部分 curl 显示呈现 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14833775/

相关文章:

objective-c - 如何在显示为模态的 uinavcontroller 中添加 View

ios - UIScrollView 不在 Swift 中滚动

ios - 呈现模态 UIViewController 时发生奇怪的崩溃

ios - performSegueWithIdentifier block UIAlertView 甚至 [activityImageView startAnimating]

ios - Swift 3 通用参数

ios - 使用 StaticString 在 Swift 中调配

ios - 如何将 Controller 传递给函数

iphone - 他们是怎么做到的?...避免无聊、千篇一律的标准 iPhone 应用程序

ios6 - 呈现模态视图 Controller ios6 时防止状态栏隐藏

ios - 如何将模态视图 Controller 中的触摸发送到父 View Controller ?