How to resolve the white screen issue appears when running an iOS app with a web view in Xcode?

 I watched this video on YouTube : Xcode How to Create a Webview for iOS Applications I followed video but if I run my app on simulator, only I see white screen.

Answered by Chris Dyer

Founding a white screen when launching a web view in an iOS app created using Xcode may be because of various reasons. The first possible reason is that you may not allow the required permission for your app to launch the video. Therefore, ensure that you allow this feature or not. If not allow the permission first. 

You should also check the App Transport Security (ATS) to allow HTTP requests. Also, make sure that you have downloaded the content( in this case, the video) correctly and that it is accessible to your simulator, an incomplete download always will show a white page in your simulator. Ensure that the web view is set up correctly or not. In it, you can try to check the constraints, delegate methods, and other possible settings. 

You can implement an error handling code to know or identify the possible reasons why your video does not launch in your simulator. Ensure also that your simulator has an active internet connection. Slow internet connectivity is also the reason for finding a white screen. If all these steps do not solve your specific problem then try a specific code snippet from your implementation so that you can gain help in looking out the problems more accurately.



Your Answer

Interviews

Parent Categories