Does WatchKit support html? is there is controller like UIWebview ?.
My client want to show webpage in a Apple Watch. is this possible ?
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.
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.
A view that embeds web content in your app.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With