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

Many thanks. I’ll try it.

1 Like

Hi Nick - I am inching my way towards the App Store ! Runs perfectly on my iPhone 5 with a nice app icon - but I’ve got completely stuck trying to get a launch screen to work in Xcode 7 using launchscreen.storyboard. I don’t think this is anything to do with the fact that it’s a web app but it’s unbelievably frustrating.

Anybody managed this ? You have to have a launch screen to get your app accepted.

@alastair
What have you done with the launch screen ?.

As far as I can see you cannot use a UIWebView or WKWebView in a Launchscreen.storyboard.
You can only use basic UIKit Views

Hi Mark - I’ve put an image on the Launchscreen.storyboard - just can’t get it to display. It should be simple but hours later I still have a white launch screen - I’ve probably just missed something. Been through it loads of times and it ain’t working. I’m going to try with a different project now !

Alastair :slight_smile:

This does not sound like a Hype problem!.

Saying that check your constraints.

Add the Image to the any,any Size class.

Then change the size class to your preferred size rep. for iPhone and or iPad.

Next use the Align tool to add 1 constraint. Horizontal in container.

Now go to the Pin tool.

Uncheck Constrain to Margins.
Click on of the pin text fields black triangles. And make sure that it is on the view rather than the margin or any other object. ( This may need to be slightly different depending on your layout but this is a basic setup)

Now click the four light red bars which will turn them a darker red. Set the numbers to what you want. These are the distances from the sides.

Click the update frame and set it to all frames.

Add the constraints.

Now test.

You will need to do this for all layout class sizes you want to provide for.

Always add elements to the any,any first. Not one of the size classes or you may not see it in any other size class.

2 Likes

Thanks Mark - I’ll give it a go and let you know how I get on. You’re right, it’s not a hype problem - it’s my last hurdle to cross and seems to be giving me more grief than anything!

Were you able to get it to work?
I just saw these response threads…so sorry for the late reply.

1 Like

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