Embed a Tumult Hype document in a Webview for publishing on the iOS App Store

Hello Nick,
I am following all your steps but I am stuck in step number 5. When I type UIwebview or uiweb or web view, it says: no matches. I tried to find a solution online and I found someone that had the same problem as me and they told him it was that he had Xcode version 7 and that he had to go back to 6. I went back to 6 but it still says no matches.
I am working on an imac with OS X El capitan version 10.11.3, Hype pro version 3.5.1 and I tried xcode 6.3 and 6.4.

I would really appreciate if you could help me out, or if there is any other way to convert HTML to an app without using Xcode.

Thank you very much for your time.
Carla

Sounds like you need to include an “import WebKit” statement at the start of your view controller file (i.e. after import UIKit).

1 Like

Hello Drew,

Thanks for answering me. Do you mean like that? Like the picture I uploaded?

Yes, if you are using objective-C that would be correct. If you are using Swift, the syntax would be a little different.

import UIKit
import WebKit

Then use:

@property (weak, nonatomic) IBOutlet WKWebView *webView;

or for Swift:

 @IBOutlet weak var webView: WKWebView?
3 Likes

Carla,

Were you able to get it to work?
If not please message me and let me see how I can help.

Thanks
Nick

Also…

New tutorial on how to do this with SWIFT 2.2 Coming very soon!!!

Nick

2 Likes

Hello Nick,
No, I wasn’t able. Since the beginning I am getting a lot of warning signs like this:

Also, there is a question mark next to my hypeshoursces, I don’t know if that is normal…I am attaching you screenshots of my hypesources, viewcontroller.m, viewcontroller.h and object window:

Carla,

When copying over your Hype.html file and your hyperesources folder
Do each one of those separately.
XCODE 6x has issues linking supporting files if you try to copy a bunch of them over at once.

Also when you copy the files over you need to make sure that the following buttons are checked.
copy items if needed
Create Folder references
And in your add to target make sure you see your apps name. See image below.

I did what you told me, first the html and then the hype resources folder just like this:

but it still appears the “?” sign next to the folder.

Two things.

If you do not see the WebKit.framework anywhere in the file explorer then you will need to added it.

Select you Xcode project. And then in the General Tab. Scroll down to Linked Frameworks and libraries.

Click the plus symbol.

A panel will slide down. Type in it’s textfield “Web”.

Select the WebKit Framework.

Now go back to you header file and change the

import WebKit to #import <WebKit/WebKit.h>

Hello Mark,

I did what you told me but it appears like this:

I see that your IOS is IOS9, mine is 8.4… I don’t know if that is the issue.

Just realised you are on an older version.

The Red text means it cannot see the file.

Remove the framework and try again. I cannot test v6 here so I cannot verify it’s quirks…

1 Like

Should I install version 7 then? Because before I had version 7 but I read on forums that it was better to downgrade because most of the tutorials were on version 6

IMHO people who said that need a slap upside the head.

Any tutorial is usually transferable to the later versions of Xcode. Because a lot of the changes that make the tutorial different are mainly UI and where to find things.

The bigger changes right now is translating a Objective - C coded project into a Swift equivalent.

If you are only staying in v6 for the reason you state then you are not really doing yourself any favours in the long run as far as I feel about it…

Carla,

I now see what is going on… Xcode 7 deprecates the old language for the web view connection.

No worries.
Please go to

And you can download the complete project and Hype template I updated for the latest Xcode which is 7.3.

Reinstall your Xcode to get back up to speed then open my project file and run in the simulator.

Let me know if this helps :slight_smile:

All: An UPDATE To this tutorial

Thanks to @carla for pointing out the language issue between XCode 7.3 and the original tutorial for XCode 6.2

I have updated the XCode Project template to reflect the changes, and a sample Hype doc and HTML file can be found on GitHub.

The steps in the tutorial are still valid but the way you reference the webview has changed a bit. Take a look at the viewcontroller .m file to see that change.

Once you download the zip file you can find the xCode Project in this directory

I hope this helps everyone out :slight_smile:

@nick is there a reason you do not use WKWebView ?

1 Like

Yes…
My first runs with WKWebview were buggy at best when I compiled the app into an iOS app.
Not 100% sure why but I defaulted back to UIWebview.
Using it to access online content seems fine though.

WKWebView is now recommended in Cordova, and is commonly in use as of Cordova 4+ due to the performance boost relative to UIWebView.

Saying that I will add a comparison and test in my Swift tutorial.
Thanks for that question!

1 Like

Hello Nick,

So I copied the new code from the xcode template project that you shared, I followed the steps from the old tutorial but when I run it to the simulator, it only shows a white screen with the name of my app and the copyright. And then this message in Xcode pops up:

Try suspending the thread…
control click on the thread and select suspend then run the simulator again.

Also since this is a universal layout maybe try to view it in the iPad simulator as well.

Nick