简体   繁体   English

当我的ios应用程序连接到互联网时,如何在不重新打开该应用程序的情况下刷新我的ios应用程序

[英]How can i refresh my ios app when my ios app get connected to the internet without re-opening the app

In the app which I am developing, I want to start/invoke my app normally when it gets connected to the internet. 在我正在开发的应用程序中,我想在连接到互联网时正常启动/调用我的应用程序。 I am using reachability class to test the internet connection but don't know how to reload the app when my app gets connected to the internet. 我正在使用可达性类来测试互联网连接,但是当我的应用程序连接到互联网时,我不知道如何重新加载应用程序。

Actually keep a separate view controller with a image view will full screen. 实际上,保持单独的视图控制器具有全屏图像视图。 This image view will serve as a splash screen. 该图像视图将用作初始屏幕。 Until the app connected to the internet. 直到应用程序连接到互联网。

[[[UIApplication sharedApplication] keyWindow] setRootViewController:splashViewController];

or present the splash view controller after app goes into background. 或在应用程序进入后台后显示启动视图控制器。 Then app comes into foreground check for network connectivity and dismiss or keep the splashViewController based on the result. 然后,应用进入网络连接的前台检查,并根据结果关闭或保留splashViewController

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM