uiwebview

UIWebView search [closed]

允我心安 提交于 2019-12-04 08:22:20
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . What is the best way to search for a string of text in a UIWebView ? 回答1: I think that the best to proceed is to: Create a javascript function that will find your text Use the stringByEvaluatingJavaScriptFromString: (see here) method to get the javascript code Call the same

How to save UIWebView content for offline display?

落爺英雄遲暮 提交于 2019-12-04 08:16:17
I'm using Xcode 7.2 and Swift to create an iOS app, on this app I display the content of my website, however if I was offline the content will not be shown. So I want to cache the webpage and display for offline. After I declared everything I'm using the following code : var URLPATH="http://google.com" let requestURL = NSURL(string: URLPATH) let request = NSURLRequest(URL: requestURL!) WB.loadRequest(request) HTML to Data let urla = URL(string: obj.1["content_url"].stringValue) if urla != nil { person.setValue(try? Data(contentsOf: urla!), forKey: "content_article") } Data to WebView let data

Check if UIWebView is loaded

筅森魡賤 提交于 2019-12-04 08:03:12
问题 I have an UIWebView in one tab that loads in viewDidLoad, but if user taps other tab the loading will be disrupted and - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error will be called, but I want to know how can check if webView is loaded if user taps the previous tab again, and if it's not loaded it will reload it, something like this -(void)viewWillAppear:(BOOL)animated { if (!webView) { NSURL *url = [NSURL URLWithString:@"url"]; NSURLRequest *request =

Client certificate authentication in UIWebView iOS

感情迁移 提交于 2019-12-04 07:52:38
问题 I'm kind of new in objective c, but I'm developing an app which has a UIWebView that loads some web content. All the web pages require client certificate for authentication and I'm struggling with it for dew days. Does anyone know the flow how to implement it in UIWebView? Thanks! 回答1: To avoid any problem in the UIWebView, you have to make a reques to you website root, with the client certificate, before the request of the web view. You can use the UIWebViewDelegate method: -(BOOL)webView:

Make a UIWebView as height as its content with Auto Layout

只愿长相守 提交于 2019-12-04 07:46:25
问题 I've got a web view embedded in a scroll view, and I want the web view to be "expanded" to show all of its content, which I then want to scroll through with my scroll view. The reason I am using a scroll View as a super view and not just using the web view as a scroll view is because I have labels above the web view that I want to include in the scrolling process (see screenshot). So how do I make the webview resize itself so it takes up all the space it needs to show the content it contains

How to open a UITextView URL in UI Web View?

泄露秘密 提交于 2019-12-04 07:44:38
In my iPhone app an UITextView is containing an URL. I want to open this URL in an UIWebView instead of opening it into safari? My UITextView contains some data along with an URL. In some cases the no. of URLs can be more than one. Thanks Sandy Assuming you have the following instances, that are also added to your UIView: UITextView *textView; UIWebView *webView; and textView contains the URL string, you can load the contents of the URL into webView, as follows: NSURL *url = [NSURL URLWithString:textView.text]; NSURLRequest *req = [NSURLRequest requestWithURL:url]; [webView loadRequest:req];

YouTube Embed player in Iframe doesn't work in iOS6

点点圈 提交于 2019-12-04 07:25:26
I really need your help. Working on an iOS app. I want to play youtube. I understood from reading many many blogs and posts, that we need to use an iframe in order to play a youtube video. However, on some videos I get: " This video contains content from XYZ. It is restricted from playback on certain sites. Watch on YouTube " I read this question: Youtube in iOS5 - done button Tapped which gives the link to youtube api: https://developers.google.com/youtube/player_parameters They recommend to use the iframe. the example for youtube site is: <iframe id="ytplayer" type="text/html" width="640"

iPad loading local HTML into web view with images and javascript

心不动则不痛 提交于 2019-12-04 07:20:56
Edit: So the answer was in this post: Loading javascript into a UIWebView from resources You'll find everything you need to know for loading an HTML5 app with directories there, just make sure you drop files on your Xcode project clicking the radio button that reads "Create folder references for any added folders". Then just use the code on that links I've added up there. Thanks to Sergio for the help. I've been through StackOverflow several times already and none of the code I find there can display the images of my html5 App. The hard part seems to be loading files from different

iOS 7 UIWebView 304 cache bug, blank pages

瘦欲@ 提交于 2019-12-04 07:10:30
I have a problem I have discovered in my app that has a UIWebView. iOS 7 caches a blank body 304 response, resulting in blank pages being shown when the user refreshes the UIWebView. This is not good user expierience and I'm trying to figure out how to solve this on the iOS side, as I do not have control over how Amazon S3 responds to headers (that's who I use for my resource hosting). More details of this bug were found by these people: http://tech.vg.no/2013/10/02/ios7-bug-shows-white-page-when-getting-304-not-modified-from-server/ I'd appreciate any help offered to how I can solve this on

How do I handle return key on an iOS web view native keyboard?

心已入冬 提交于 2019-12-04 07:02:32
问题 In my iOS app, I have a UIWebView with text fields . I'd like to respond to the Return key being tapped. How do I do that? Can I somehow get access to the UITextField so I can implement UITextFieldDelegate method textFieldShouldReturn? Or is there some other way to accomplish this? 回答1: You need to do some JavaScript tricks for this. In your HTML document, bind a keyup event callback for your text input control, (Last time I checked, somehow UIWebView doesn't fire keypress event for return