Difference between UIWebView(deprecated) and webkit View in swift - ios

I am starting learn webview in ios swift but i am unable to understand the difference between uiwebview and webview kit. recommend some article or documentation so that i can make it clear.

UIWebView is deprecated and should not be used in apps and WKWebView is the replacement for that .
If you compare it performance wise, WKWebView outperforms UIWebView in case of memory consumption as UIWebView consumes a lot of memory to load the same webpage and WKWebView on the other hand does not consume that much. You can easily create a demo app and see for yourself
As per Apple Documentation
In apps that run in iOS 8 and later, use the WKWebView class instead
of using UIWebView
So, to sum it up, if you want to load a webpage inside your app, you can use WKWebView
Also, not really what you asked for, but you should also look inside SFSafariViewController if you want some Safari related features such as Reader, AutoFill, Fraudulent Website Detection, and content blocking.
You can find more about SFSafariViewController

Related

Fast-Tap in UIWebView and WKWebView

WebKit's fast tap functionality has come to Safari in iOS 9.3 (see documentation). I work on an e-reader app that uses a web view to display text. We still use UIWebView because of various bugs in WKWebView, but I can switch out to WKWebView very easily for testing purposes. We have our own custom touch handling to get around the 350 ms touch delay so links feel faster. I just tried out the fast-tap thing, and it only appears to work in WKWebView. Is this correct / confirmed / documented somewhere? Or should fast-tap work in both UIWebView and WKWebView?
Update: here is an article about some changes toward the current fast-tap behavior in iOS 8 that only appeared in WKWebView. But nothing about the new iOS 9.3 stuff.

Multiple webview in an app or one

I'm creating an ios/android app that is implemented with partially native code and html5/css and built-in mobile webkit, I need to make it support both ios and Android, hence the html5/css selection. In my app I created a tabbar with 4 tab buttons, each tabview contains a webview, the tabs and tabbars are implemented natively, meaning the code for this is either objective-c or Java. What happens in those webviews are html5/css/js... I wonder if this is the appropriate way to implement it, or should I wrap the whole thing up in one single webview, and implement everything using html5, including the tabbar. Or let me ask this way, what did facebook do with its tabbars in its app? I'm concerning about user experience and seamless transition/animation.
If I can mimic the native ios/Android tabbar using html5, how may I? Anyone could maybe provide a link to a tutorial? Thanks!

NSLog (or other monitoring event) within UIWebView operations

I'm moderately experienced with iOS, but I'm using UIWebView for the first time on this project.
I'm wondering, is there a way to monitor the line-by-line, internal operations of a UIWebView in Xcode? Maybe drop some NSLogs in there, or some breakpoints? The delegate methods cover the pre- and post-load stuff, but there doesn't seem to be any interface to actually track what the WebView itself does when it loads a page.
Specifically, I'd like to be able to track the app's behavior as each image from a webpage is downloaded and stored. I'm getting some weird errors around an image being unusable on iOS 7, but my PHP/JavaScript swears that everything is fine on its end, and the image seems fine on desktops and on iOS 6. I'm increasingly certain that the problem has to do with the WebView itself, (an answer to a related question seems to suggest it could be about WebKit calls on different threads), and I'd love to breakpoint my way through, or NSLog some key points or something, just to rule some stuff out.
Is anything like this possible? Or is UIWebView a private party that you can only hear about once it's over?
Does it break in Mobile Safari or only in your app?
You can point Safari's web inspector on OS X at Mobile Safari running in the iOS simulator or even on an iOS device (it has to be enabled in settings).
This will allow you to view all the HTTP headers and so on.
Another option is to use something like wireshark to monitor TCP traffic, but that's a lot more complicated.
http://webdesign.tutsplus.com/tutorials/workflow-tutorials/quick-tip-using-web-inspector-to-debug-mobile-safari/

Support for WebView

Does video.js support Android WebView?
We use an Android app to put a tablet in Kiosk Mode in which our web app runs. However, webview video tag does not give us a image of the first frame, only the ugly widgets background.
A better question might be whether your WebView supports video.js. You need to configure the WebView to behave equivalently to a proper browser – HTML5 video definitely won't work without some tweaking. I've found this custom web view to work well (including with video.js):
https://code.google.com/p/html5webview/

Difference between content in uiwebview and mobile safari?

I am showing a twitter feed in a uiwebview... however there is a problem: it appears significantly differently in the uiwebview then what it does in mobile safari. Ultimately, I much prefer the look of the feed as it is shown in mobile safari. Is there any way to 'trick' the web view into displaying itself as safari? Possibly by altering the user agent? Thanks.
Ended up altering the user agent. App made it past apple review fine.
UIWeView and Safari doesn't display all the pages as the same..There can be minor differences in formatting in UIWebView which won't be found in Safari..
Solution to this is to use javascript to alter the WebView itself programmatically to display things right..
more info avaialble in UIWebView Class Reference doc here

Resources