Open Source UIWebView Library Adding Response Handling, User Agent Setting And More

In the past I’ve mentioned some UIWebView alternatives most recently TOWebViewController and DZWebBrowser.

Here’s a library providing a UIWebView subclass adding a number of nice features called OTMWebView from Otium.

OTMWebView adds features for response handling, progress tracking, detecting title changes, and the setting of user agents to the web view.

Here’s a code snippet from the readme showing how to use the response handling capability:

(void)webView:(OTMWebView *)webView didReceiveResponse:(NSURLResponse *)response forRequest:(NSURLRequest *)request {

<pre><code>if ([response.MIMEType isEqualToString:@"video/mp4"]) {

    [webView stopLoading];
    // Do something else…
}
</code></pre>

}

You can find OTMWebView on Github here.

A nice UIWebView enhancement.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Open Source UIWebView Library Adding Response Handling, User Agent Setting And More

©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *