uiwebview

UIWebView events and hold to select/copy

可紊 提交于 2019-12-22 12:19:56
问题 I have created a subclass of UIWebView and have added a UIView on top of it in order to catch the touch events and use them. Now, due to the extra view added on top of the UIWebView the text selection is not working at all. When I remove the extra UIView the text gets selected but then I cannot identify the events. Is there a way by which both the functionalities can co-exist? [EDIT] May be my post was not clear enough. When I subclass UIWebView to handle events, selection stops working. I

Download and cache entire web page on ios

佐手、 提交于 2019-12-22 11:22:05
问题 I need to download an entire webPage and store it in app's documents directory and load it from the cache the next time user visits. No matter how much I search, I always end up with ASIWebPageRequest..!! even though, it works, its very old and deprecated.So I am looking for some alternatives. Another reason I am trying to avoid it is because .... It is a completely reimplemented URL loading system, based on very low level constructs (CFNetwork). So as Apple makes improvements to their high

UIWebView load fails with custom URL scheme

倾然丶 夕夏残阳落幕 提交于 2019-12-22 11:18:10
问题 I have a UIWebView that is handling an OAuth authentication flow in my app. The callback URL that the OAuth service uses points to a custom URL scheme I've set up in my app, let's call it mycustomurlscheme . So once the user authenticates successfully, the OAuth service redirects them to the URL mycustomurlscheme://oauth/success?oauth_token=xxxxxxxxxxxxxxxxxxxx&oauth_verifier=xxxxxxxxxxxxxxxxxxxx . When the UIWebView requests this URL, the app behaves correctly; namely, the application

UIWebView doesn't detect phone number links

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 11:11:51
问题 I'm building an app with a UIWebView in it. The webView should load html that includes tel: links: <a href="tel:123456789">call me</a> The webView doesn't make the "call me" link to be clickable. I tried webView.dataDetectorTypes = UIDataDetectorTypePhoneNumber But doesn't work. I looked in all the stackOverflow Q&A's and found no answer specific to this problem. Thanks for your help, Nur 回答1: replace <a href="tel:123456789"> call me </a> with <a href="tel://123456789">call me</a> Hope it

UIWebView With PDF

血红的双手。 提交于 2019-12-22 10:55:16
问题 I'm displaying a PDF file using UIWebView , and I want to do 2 things: I want to make the page fit the phone screen without the user has to double tap to do that I want to remove the margin with gray shadow around the displayed PDF Thanks for helping 回答1: I don't think this will help much, but I think your best option is to render the PDF to an image (of decent DPI) and show the image instead. I do this for an app, but we do that server side using ImageMagick - don't know how you might do

How can I get the URL from webView in swift

て烟熏妆下的殇ゞ 提交于 2019-12-22 10:26:59
问题 I have question, how can I fetch the url from the webView ? I perform the following code and I get the nil Code I'm trying : override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(true) webView.loadRequest(URLRequest(url: URL(string: "https://www.youtube.com/watch?v=Vv2zJErQt84")!)) if let text = webView.request?.url?.absoluteString{ print(text) } } 回答1: You are not getting url because webView has not finished the loading of that requested URL , you can get that URL in

webview loaddata scroll setting not updating till clicked

折月煮酒 提交于 2019-12-22 09:49:20
问题 I update the html in a webView using loadData() followed by a reload(). I get the new data to display but the scroll of the page has not updated. I want to keep the view of the page at the bottom. I can wait a long time and it still doesn't update. Once I click the webView the scroll bars adjust and I can drag to the bottom of the page and see the new text. Things I have tried: - multiple settings and calls in onPageFinished(). None worked because the getContentHeight() hasn't changed yet. I

Link follows when using UIWebView+AFNetworking

半世苍凉 提交于 2019-12-22 08:59:31
问题 I'm trying out AFNetworking 2.0+'s new UIKit+AFNetworking extension for UIWebView , loadRequest:progress:success:failure: . So far so good, but after the initial request is made, additional requests caused by user interaction falls back to the built-in loadRequest: of plain UIWebView . I'd much prefer that all requests went through the AFNetworking improved one. Preliminary, I'm thinking I should override as much as possible by returning NO in shouldStartLoadWithRequest and call loadRequest

UIWebview scrollview changes contentsize for no reason

北战南征 提交于 2019-12-22 08:34:09
问题 I have a uiviewcontroller which loads a uiwebview. When the uiviewcontroller loads the uiwebview everything is done correctly. But when one navigates away and returns back and the uiwebview is not loaded, it is displayed differently. The uiwebview scrollview's contentsize height changes by 64px, it gets higher. When it is loaded for the first it looks like this When one returns back to the view, this is what happens I hope I was able to make my problem understandable. If more details are

UIWebView intercept “setting movie path:” from javascript audio player

a 夏天 提交于 2019-12-22 08:07:17
问题 In iOS 4, I've got a page loaded in a UIWebView with a javascript audio player. I did not create this player, it is owned by a third party, so I can't tinker with it. When I click the play button, I see an NSLog printout like the following: setting movie path: http://data.myaudio.com/thefile.mp3 My question is, what is getting it's movie path set and how do I intercept it? The audio will continue to play until I create another UIWebView, or use the built in audio controls accessible by an