Many of you iOS developers may have come across the need to render HTML within your native iOS app, at some point in your mobile app development career. In such cases, have you ever found it necessary to call and execute certain native functions from within your embedded HTML code? For example, how does one print the screen’s contents whilst in an HTML Web View? We came across just such a business requirement recently, and thought it worthwhile to share how we solved this problem.
shouldStartLoadWithRequest method of the UIWebView delegate
A working sample is available at: https://bitbucket.org/calceytechnologies/js-ios-bridge/