【发布时间】:2018-10-05 12:59:06
【问题描述】:
考虑两个视图控制器 Controller1 和 Controller2,我在控制器 1 中创建了许多 UITextField 的表单,当用户单击特定的 UITextField 时,它会移动到 Controller2 并选择那里的数据.
选择Controller2中的数据后,它会自动移动到Controller1,而从控制器2返回控制器1时,其他UITextfield数据被清除,只找到控制器2中选择的数据。选择后我需要在UITextfield 中找到所有数据。
这是从Controller2返回到Controller1的代码
if(Constants.SelectedComplexName != nil)
{
let storyBoard: UIStoryboard = UIStoryboard(name: "NewUserLogin", bundle: nil)
let newViewController = storyBoard.instantiateViewController(withIdentifier: "NewUser") as! NewUserRegistrationViewController
self.present(newViewController, animated: true, completion: nil)
}
【问题讨论】:
-
添加您的 VC1 代码以及如何从 VC2 弹出到 VC1
-
@Anbu.karthik 我的 VC1 代码让 storyBoard: UIStoryboard = UIStoryboard(name: "NewUserLogin", bundle: nil) let newViewController = storyBoard.instantiateViewController(withIdentifier: "ComplexList") as! ComplexSearchViewController self.present(newViewController, animated: true, completion: nil)
-
您可能想要使用展开转场。请看stackoverflow.com/questions/35313747/…
-
仅找到来自 controller2 的选定数据 - 您如何将数据从 controller2 获取到 controller1?
标签: ios swift uiviewcontroller