I am using WKURLSchemeHandler
to serve local files that cannot be read directly by the WkWebView
. While it works fine for small files like videos, it totally freezes the application when it has to provide big files like videos.
Right now, I am reading the full file in a single step which is inappropriate for important files.
data = try Data(contentsOf: fileUrl)
How should I do in order to avoid this? Is there a way to "stream" the content of the file?