0

Three useful UIWebView tweaks

-

It is a well known fact among iOS developers that creating screens with complicated formatted text is a hassle. UILabel, UITextView, and friends are not really designed for that purpose. The alternative that is often used to overcome those limitations is the versatile UIWebView combined with some local HTML content and CSS styling.

But the UIWebView itself comes with strings attached. In this post we are going to share three small tips that might help in making the UIWebView look more integrated with the rest of your UI.

(more...)

0

CMHTMLView for iOS

-

CMHTMLView is UIWebView wrapper to provide easy access to show rich text content (HTML) with native look and feel. Features: 100% native look and feel, offline images support, low memory usage.

Full
You can find CMHTMLView and the example at the Github repo here.

Features

  • 100% native look and feel
  • Offline images support
  • Low memory usage
  • Stable (never crashed)
0

Open Source: Library For Easily Communicating With Objective-C Code From A UIWebView

-

 

I’ve mentioned in the past instances when you may want to use a UIWebView for tasks such as rendering .SVG files, but there could likely be instances when you want to go the other way. I see questions on how to do this popping up time and time again.

Communicating with the webview itself is easy as you can execute Javascript code using the UIWebView stringByEvaluatingJavaScriptFromString but going the other way things can get a bit hacky.

I’ve come across a very easy to use Javascript and Objective-C  library that allows for two way communication with a UIWebView with just a few lines of code.

The library is from Marcus Westin and can be found with full documentation, and an easy to understand example here:

https://github.com/marcuswestin/WebViewJavascriptBridge

If you ever find yourself struggling to get some Javascript running in a UIWebView to communicate with your Objective-C code you can use this library which makes things a snap, and of course since it’s open source you can take a look at how things are done.

Open Source: Library For Easily Communicating With Objective-C Code From A UIWebView | iPhone, iOS 4, iPad SDK Development Tutorial and Programming Tips.