A
A
alex_6432020-07-20 12:16:44
Swift
alex_643, 2020-07-20 12:16:44

How to transfer data between 2 remote VCs?

Hello! I need to transfer data between two VCs that are very distant from each other. I tried Notifications but nothing comes out, is there any local storage for any data. For example, in 1 VC I store data in storage and in another I take data from there. Is there such a thing? Or what else can be used?
5f1560ef1ae43941654151.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Vorobei, 2020-07-20
@ivanvorobei

Most likely you need to use either UserDefaults or a database . Depends on the data and task.

I
iMaximus, 2020-07-20
@iMaximus

I'll add a little. It depends on how much you need to store this data and on their quantity. If there is a lot of data and they need to be protected constantly, as UserDefaults already said, the sqlite or plist database (essentially the same UserDefaults).
If it's just a one-time transfer of data, then you can delegate or singlton. But singlton is now being punched in the face in many organizations.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question