N
N
nastya_zholudeva2018-06-07 19:24:04
Swift
nastya_zholudeva, 2018-06-07 19:24:04

How to redirect to another "page" after successfully loading data from the API?

I need that when the user enters the application, a loading scene (loader) appears and after the data from the API has arrived, another scene appears.
How can this be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
doublench21, 2018-06-07
@doublench21

You don't need to create a scene for this. It is enough to add a UIView with UIActivityIndicator to your main view, namely UIWindow. In the viewDidLoad method, you initiate, namely, add a view to the UIWindow and call the start method on the UIactivityIndicator. And in the compliment of your request, you do exactly the opposite. Stop and remove. More precisely, I will write later, if necessary. I write on the road.

V
Vadym Piatkovskyi, 2018-06-09
@Zinapp

After the data has loaded, call the Success Block (to be created), after which - present, or performSegue :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question