Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does WatchKit support html? is there is controller like UIWebview?

Does WatchKit support html? is there is controller like UIWebview ?.

My client want to show webpage in a Apple Watch. is this possible ?

like image 963
Chamath Jeevan Avatar asked Jun 15 '15 07:06

Chamath Jeevan


People also ask

What is the difference between UIWebView and WKWebView?

Unlike UIWebView, which does not support server authentication challenges, WKWebView does. In practical terms, this means that when using WKWebView, you can enter site credentials for password-protected websites.

Is UIWebView deprecated?

Apple is phasing out UIWebView, which is used by developers for integrating web content into an app in a quick and secure manner. Apple is replacing UIWebView (and WebView) with WKWebView, an updated version, as UIWebView has been deprecated.

What is UIWebView on Apple Iphone?

A view that embeds web content in your app.

Does WKWebView use Safari?

WKWebView - This view allows developers to embed web content in your app. You can think of WKWebView as a stripped-down version of Safari. It is responsible to load a URL request and display the web content. WKWebView has the benefit of the Nitro JavaScript engine and offers more features.


1 Answers

There's no UIWebView in WatchKit (neither WatchOS 1 nor WatchOS 2).

However, it's fully possible to work around this:

You can load the HTML, pick out the relevant content, and display that in for example a Label. This is however not a smart solution, as the website owners can change its layout and render your app useless until you update it.

My suggestion is to send a GET-request to the server and receive the relevant data in JSON-format if they have an API. If they don't, you can use a service such as Kimono to convert the website into an API.

Or you could set up your own server which works as the API. You simply send a request to it, it queries the website/ loads the HTML, and returns the relevant content to your app.

In any case, the solution is to get the relevant content from the website and display that using labels and image views.

like image 91
Aleksander Avatar answered Sep 27 '22 20:09

Aleksander