-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: how does this work in iOS #27
Comments
@StevePotter It is pretty simple, It has a forever loop which sleeps for 0.1 seconds. So once the React-Native lunches, then you have a chance to break that loop by calling hide method. |
@alinz I'm still confused. Does it occupy the main run loop, which causes UI events not to process, until hide is called? |
@StevePotter it does block. but because it sleeps for 0.1 seconds, it gives enough time to other tasks to be executed, But because you will break the loop in few seconds, I think it's ok! The elegant and more complex solution would be register for callback and let the os signal us when a task is done. But that requires a lot of code and to be honest with you, I would rather use the simple code than very deep complex code. |
@alinz could hide statusbar on the ios platform when splash is shown? i am poor of Object-c. thanks. |
@iamweilee, There are multiple ways of doing this. |
@crazycodeboy could you please explain to me how the code in https://github.com/crazycodeboy/react-native-splash-screen/blob/master/ios/SplashScreen.m prevents the splash screen from hiding until hide() is called? I'm good with objC but don't understand the trick involved here. If you explain it and agree with me, I'd be happy to add a comment in the code for curious people like me.
The text was updated successfully, but these errors were encountered: