返回使用缓存数据查看控制器
我正在构建一个具有4个屏幕的应用程序,在第二个屏幕上,用户将按桌面上的日期进行时间设置时间。
几次要设置(取决于array.count.count
)。 在第三个屏幕上,用户将设置位置,在第四屏幕上,用户将看到API的信息,并且时间是由用户设置的,也是在TableView单元格上设置的。
如果用户想更改或更新他在一个单元格中设置的时间到不同的时间,我需要能够返回第二个视图,而所有输入用户已经剩下,并且用户只能更改他们想更改的单元格,而无需全部添加。
当我使用SEGUE时,它会创建一个新的第二VC,并删除了所有先前的信息。
I'm building an app which has 4 screens, on the second screen the user will set time by date-picker on tableview.
There are few times to be set (depending on array.count
).
On the third screen the user will set the location, and on the 4th screen user will see info from API and the time has been set by the user, also on tableview cells.
In case the user wants to change or update the time he set in one of the cells to different time, I need to be able to go back to the second view with all the input user added already remain, and the user can change only the cells they want to change, without adding all the time all over again.
When I'm using segue it creates a new 2nd vc and all the previous info erased.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我必须使用委托来传播这些信息,无论您想要的屏幕哪个屏幕。为了实现这一点,您必须失去segue。
https://medium.com/@nimjea/delegation- swift-swift-4-2-f6aca61f4bf5
在此链接委托模式中,很好地解释了。请参考。
I thing you have to use delegate to propagate this information from whichever screen to which ever screen you want. In Order to achieve that you have to loose the segue.
https://medium.com/@nimjea/delegation-pattern-in-swift-4-2-f6aca61f4bf5
In this link Delegation pattern is explained very well. Please refer that.