返回使用缓存数据查看控制器

发布于 2025-02-10 08:38:02 字数 305 浏览 2 评论 0原文

我正在构建一个具有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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绿萝 2025-02-17 08:38:02

我必须使用委托来传播这些信息,无论您想要的屏幕哪个屏幕。为了实现这一点,您必须失去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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文