Thanks, Nick, I appreciate your time. I’ve kind of been pulling my hair out over this. Documentation is trying to push folk from UIWebView to WK WebView, so I thought I’d give it a try. But, while webview is fairly straightforward, WKWebView, as you’ve mentioned, is much less so.
With your code, for the baseUrl, I’m unclear how to write the string. Say I have a folder, called Project, that I’ve copied into my xcode. Inside Project is my project.html file and its resource folder, called Folder. How would I define the string? I seem to be labeling things incorrectly because it’s still not seeing the resources.
Hmm.. I have not seen this issue and have used wkwebview in the past with no issues
I just did a convert on the project to use modernised swift syntax and update to modern Xcode.
Apart from Xcode throwing up some errors about some notifications syntax. Which can be ignored , just rerun build and they go away Xcode seems to jst want me to wast my time writing the line again.
All still works .
Thanks. In this, I’m looking for an alternative for #selector(enterBackground), as my Xcode is not liking the enterBackground. Swift keeps changing, which I guess is a good thing/frustrating thing.
Thanks for the insight Mark!
I will give this a go tonight and prepare another addendum to the video tutorials.
I have been working off and on with the Android version as well as prototyping templates for iOS and Android in Hype…now that I understand how to load SanFrancisco fonts
Thanks @Daniel !
Wow, thanks, Mark. You’ve made use of the evaluateJavaScript thing, here. I had been looking at that, thinking it might make sense, but wasn’t sure how to implement it. And you have created an enterBackground function. For some reason when I had tried that, I ended up with a new error. Going to have to recheck my typing.
Thanks again!
This really is one of the best forums, due in great part to folk like you both.
I don’t know if anyone else already encountered this problem, so here I go.
Until now everything worked smoothly and I’d like to thank @nick for his excellent tutorial. But we have Xcode 9 now and my earlier projects don’t work anymore because of: Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0). This warning comes after the line: let myRequest = NSURLRequest(url: localfilePath!);
and also: fatal error: unexpectedly found nil while unwrapping an Optional value
I can’t seem to fix it. Do you have a solution?
you still forgot the html files. But I just added my own.
I suspect that the issue is that the html index.html and the hyperesources folder have not been added to the ‘Copy Bundle Resources’ in the build phase for the project.
Sorry, I don’t get it. I have done it this way for some time now and all over sudden it stops working. I already have a test version off the app in the App Store. Here is a screenshot of the ‘error’. And where would I find "Copy Bundle Resources’?
While working on this I found out it is a bug in Xcode 9.0
It should not happen especially if you check your “Add to Targets” box.
I have tried it now several different ways and the best way is the manual Copy Bundle Resources.
Video will point this out…and I hope they fix it because while it is not that much of a lift you would expect it to copy automatically.
Good catch, I was sure I did have that checked when I added mine in the test.
It’s what threw me for a bit and I went through a few things before I checked the copy… and then doubted myself on it.