What is GCDWebServer for?

守給你的承諾、 提交于 2019-12-08 21:45:52

问题


I have a problem when loading the local web from WKWebView in iOS8. There are some suggestions that I should use GCDWebServer. I read through GCDWebServer, but not really understand what GCDWebServer is for on mobile application's side.

Could you give me any practical case of using this library? Sorry for my ignorance.


回答1:


It's a webserver that you can run on your iOS device. Just like you would run a webserver on VPS or dedicated server providers.

This webserver that you would run and host from your iOS app will of course be available only in the network your iOS device is connected to.

This makes it useful for you to write client programs or scripts on other machines but connected to that network, to call your iOS app (running the GCDWebServer) to upload or download files that you so choose to store in your iOS app's sandboxes document directory for instance. Or as simple as viewing HTML or other data - plain text or json - served by GCDWebServer.

It had nothing to do with what WKWebView. WKWebView is a 'simplified WebKit browser client' that you can implement in your iOS app to view web pages served from other webserver hosts.

You can think of WKWebView as the complete opposite of GCDWebServer.



来源:https://stackoverflow.com/questions/29345909/what-is-gcdwebserver-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!