uiwebview

How to get requesting UIWebView from inside of NSURLProtocol

[亡魂溺海] 提交于 2019-12-07 08:04:17
问题 My app uses subclassing of NSURLProtocol. There are several UIWebViews in the app and for specific algorithm implemented in NSURLProtocol I need to know which one of the UIWebViews sends the request. My understanding is that object returned by [self client] should be somewhat connected with requesting object. But neither NSURLProtocolClient (that is the protocol implemented by object returned by [self client]) nor underlying object _NSCFURLProtocolBridge have any properties/methods to get the

UIWebView won't goBack after loading HTML in iOS

纵然是瞬间 提交于 2019-12-07 06:40:18
问题 I'm having this problem in my iPhone app: I have a webView which is first loaded with an HTML string. After the user clicks a link and it loads the requested page, the webView won't go back when I call the method [UIWebView goBack]; I suppose webView doesn't cache the HTML string. Is there any way I can make webView cache my HTML string without having to save it in a NSString myself? 回答1: You can use the canGoBack property and if you can't go back, reload the UIWebView with the original html.

Pre-fill WebView text fields

此生再无相见时 提交于 2019-12-07 06:12:23
问题 I need to pre-fill text fields in a UIWebView and am given to understand that javascript is the best way to go about this. Unfortunately I know nothing of javascript and have been fumbling about for the last few hours, getting nowhere. Latest botched attempt: - (void)webViewDidFinishLoad:(UIWebView *)webView { // username field id = username_5 & pw field id = password_5 NSString *javascript = @"\ var user = 'testUser';\ var pw = 'testPW';\ document.getElementById('username_5').value = user; \

add UIButton as subview of UIWebView and resize it when zoom

核能气质少年 提交于 2019-12-07 05:49:22
问题 I have the image of the World map in .svg that i load into UIWebView . (I used svg format and UIWebView because the image is too big to load into UIImageView) I would like to put a bunch of Pin on this map with fixed position. For example if I put a pin in Brazil, this pin must always remain on Brazil, no matter if I scroll or zoom the UIWebView how you can do this? for now the scroll is not a problem but only the zoom NSString *path = [[NSBundle mainBundle] pathForResource:@"map" ofType:@

Open iOS6 Apple Maps app from a link in a UIWebView

有些话、适合烂在心里 提交于 2019-12-07 04:47:09
问题 If I display a link to a map in a webpage <a href="http://maps.apple.com/?q=Pricketts+Hill+Southampton+Hampshire+SO32+2JW&ll=50.913127,-1.191398">Location</a> it opens the native iOS6 Apple Maps app when clicked in the standard iPhone Safari browser. When I display the same webpage in a UIWebView inside my app and then click the link, my delegate method - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType

Do all browsers on iOS use WKWebview or UIWebVIew?

喜夏-厌秋 提交于 2019-12-07 04:46:45
问题 I am curious about third part browser on iOS(Chrome or FireFox) Does all of them use the WkWebview or UIWebVIew to show then web page, but do many extra work like cache etc? So, if I want to write a browser on iOS, I must use WkWebview to show the web page and wrapping it to do more stuff? 回答1: Yes, Apple forbids other web engines explicitly (or only allows the WebKit respectively) in § 2.5.6 of App Store Review Guidelines: 2.5.6 Apps that browse the web must use the appropriate WebKit

Autofill Username and Password in UIWebView

。_饼干妹妹 提交于 2019-12-07 03:38:37
问题 I'm doing a very easy app for me. When I launch this app, it simply bring me to this web page https://social.tre.it/expert. I would like to automatise login so is there a way to autofill username and password, check the "I accept condition" mark and push "login" button? I tried this Autofill Username and Password UIWebView Swift but it doesn't work, I'm not the creator of the page so I don't know exactly how it's structured. Would be cool even if iCloud keychains would fill the forms...but

Programmatically zooming a UIWebView without gestures - Center Point not calculated correctly

瘦欲@ 提交于 2019-12-07 03:31:03
问题 The Problem I have a UIWebView inside my iPad application which I need to zoom programmatically, but without the use of gestures/taps. The app. has a "+" and a "-" button for zooming in-and-out in user-defined increments (it is an app. for the visually impaired). This +/- zoom-button functionality previously worked 100% fine when my app. used a UIImageView inside of a UIScrollView (instead of the WebView). The ImageView was the actual view which was zoomed, and the CenterPoint was calculated

Is it possible to remove [“Page 1 of 20” view] in a UIwebview when displaying pdf?

丶灬走出姿态 提交于 2019-12-07 03:12:58
问题 I can not get to a solution after much googling. I have a UIWebView with a PDF in it. I do not want the view: "Page 1 of 20" The small view in the upper left corner when viewing a PDF file. It is possible to remove this? 回答1: Swift 3 and WKWebView I get all the subviews of the WKWebView and then remove WKPDFPageNumberIndicator : func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { let webViewSubviews = self.getSubviewsOfView(v: self.webView) for v in webViewSubviews { if

NSURLConnection delegate method: didReceiveData not called …Why ?? (iPhone SDK)

你离开我真会死。 提交于 2019-12-07 02:09:26
Sample Code: -(void)ConnectWithRequest:(NSMutableURLRequest*)req{ if(![req isEqual:theRequest]){ [req retain]; [theRequest release]; theRequest = req; } XMLConnection = [[XMLWebServiceConnection alloc]init]; Connection=[[NSURLConnection alloc]initWithRequest:theRequest delegate:XMLConnection]; } In XMLConnection class I have implemented NSURLConnection delegate methods: -(id)init{ if(self=[super init]){ receivedData = [[NSMutableData alloc]init]; //member of a class } return self; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{ [receivedData release]; } -