Building42 / Telegraph

Secure Web Server for iOS, tvOS and macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you build a server with this library for offline resource loading of WKWebView

hziKen opened this issue · comments

Hi @hziKen

English
You can use the serveBundle option to serve offline resources from your app's bundle.
See the routes section of the README. Also please check out the example app of the project. Once you have a running server, you can treat it like any other webserver and point your WKWebView to the server's url.

Traditional Chinese (translated with Google Translate)
您可以使用serveBundle選項從應用程序包中提供離線資源。 請參閱自述文件的“路線”部分。 另外,請查看該項目的示例應用程序。 擁有運行中的服務器後,可以將其像其他任何Web服務器一樣對待,並將WKWebView指向服務器的URL。

@hziKen Sorry, I can't give a complete WKWebView example right now. Here is a basic explanation of how WKWebView works:
https://www.hackingwithswift.com/read/4/2/creating-a-simple-browser-with-wkwebview