Learn Courses My Dashboard

Wait until a function responds

If your DataBase has a lot of information in it, it may take some time to find a specific data you want.

At the start of an app, this can’t be a problem, because you may use just your account to retrieve data. But what if there are more than 1000, or 10 000, or 100 000, or more accounts, who knows?

What shall anyone call in its SwiftUi program, to do a certain thing, just after The Called Function has returned successfully all the data asked for?

Thanks in advance, cheers.

You should first design your database in a way to make calls quicker. By creating your schema properly

Also you should use callbacks (closures) to execute code after data returns.

What data are you returning? Just a little bit of data that many users can all return? This is technically more about how many database connections and calls your backend can handle at once, not necessarily an app issue