uiwebview

UIWebView throwing exception for [WebActionDisablingCALayerDelegate setBeingRemoved:]

一曲冷凌霜 提交于 2019-12-03 00:41:49
问题 When running against iOS 8, I began to see the following exception coming from the deep bowels of UIWebView : [WebActionDisablingCALayerDelegate setBeingRemoved:]: unrecognized selector sent to instance 0x167ee900 * WebKit discarded an uncaught exception in the webView:willRemoveScrollingLayer:withContentsLayer:forNode: delegate: -[WebActionDisablingCALayerDelegate setBeingRemoved: This is happening when I change some constraints on my UIWebView and then call: self.webViewWidthConstraints

iphone: View on top of UIWebView?

*爱你&永不变心* 提交于 2019-12-03 00:31:16
I'm working on a browser app, and I have an address bar on top the UIWebView. On MobileSafari if you scroll down, the address bar starts to move to the top, out of the screen, and the UIWebView doesn't scroll. Only when the address bar disappears completely, it starts to scroll. I would like to have this effect in my app as well. What's the best way to implement this? Thanks The only way to implement this requires iOS 5. In iOS 5, UIWebView has an UIScrollView subview. And use the following code: Set a area for the address bar: [[myWebView scrollView] setContentInset:UIEdgeInsetsMake(64, 0, 0,

How to cancel a UIWebView?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 00:30:27
I'm modally presenting a UIViewController with a UIWebView as its view. How do I dismiss the UIWebView when the user hits a cancel button on it? One idea I have is to have the cancel button link to http://cancel and then check in - (void)webViewDidStartLoad:(UIWebView *)webView If webView.request.URL.host isEqualToString:@"cancel" , then dismiss the view controller. Does the host have to have a dot in it, e.g., "cancel.com"? Rob Napier You're on the right path, but you're approach is slightly off. You don't need or want this to be an HTTP URL. Make your URL cancel: . <a href="cancel:">Thing to

Prevent universal links from opening in `WKWebView`/`UIWebView`

时光总嘲笑我的痴心妄想 提交于 2019-12-03 00:29:58
When user tap on a universal link in WKWebView , the corresponding app will be opened (if installed). This is described in Apple Search Programming Guide If you instantiate a SFSafariViewController, WKWebView, or UIWebView object to handle a universal link, iOS opens your website in Safari instead of opening your app. However, if the user taps a universal link from within an embedded SFSafariViewController, WKWebView, or UIWebView object, iOS opens your app. In my app, I have a WKWebView , but I don't want the user to go out of my app. I want to handle the link within my WKWebView . How do I

Avoid main thread freezes when UIWebView tries to blockingly lock the web thread

寵の児 提交于 2019-12-03 00:26:47
All UIWebViews share a single web thread. When one of them is init -ed, removed from superview etc., they will attempt to lock the web thread from the main thread in a blocking fashion, thus temporarily freezing the run loop of the main thread. If the web thread is busy, e.g. while doing a long synchronous XMLHttpRequest , this may block the main thread for a long time. Is there a way to avoid this? If I could modify UIWebView, I'd just make the lock attempt non-blocking, but obviously that's not the case, so I'm looking for other clever ideas. The long and short of it is: avoid doing anything

Safari - iPhone simulator debugging (via “develop”) not showing anymore

狂风中的少年 提交于 2019-12-03 00:10:20
I am using iPhone simulator to run a UIWebview, and Safari browser (on my mac) in order to debug the js / html / css code (via "develop" menu -> iPhone Simulator -> choosing my webview). Yestarday, the iPhone-simulator option disappeared from my "develop" menu: (as you can see, the "iphone-simulator" is missing here (it is opened in the background and working...) Any idea? Edit: I am using iOS 7 iPhone simulator + Safari 7 Edit 2: Just tried opening a website on iphone-simulator's Safari browser (in addition to the UIWebview). No luck here as well... I had exactly the same problem and I could

How to send events from HTML running inside a UIWebView to native Objective-C code?

南笙酒味 提交于 2019-12-03 00:08:42
I want to integrate a full HTML framework (ie HTML/CSS/JavaScript) inside an iOS app and make the UIWebView in charge of running the HTML content being able to communicate with the rest of the native Objective-C source code. Direction 1: from Objective-C to HTML inside a UIWebView The way to make the rest of the source send messages to the HTML content is pretty straightforward: i can just call stringByEvaluatingJavaScriptFromString: on the Objective-C side and implement JavaScript methods the right way. Direction 2: from HTML inside a UIWebView to Objective-C This is the way I can't really

How to tell the difference between an iframe loading vs. entire page loading in a UIWebView?

陌路散爱 提交于 2019-12-02 23:18:38
In the [webView:shouldStartLoadWithRequest:navigationType:] event, how can you tell the difference between an iframe that's loading content vs. the entire page loading content? It seems like the both call this same event with the same arguments, the only difference being the URL that's going to be loaded, so there is no way to tell the difference between the two. I've thought of a few ways to tell the difference though: Parse the source code of the page and store a list of all the iframe src attributes, assume that if the url loading is one of those in my list it's an iframe. Of course this

How to disable UIWebview horizontal scrolling?

回眸只為那壹抹淺笑 提交于 2019-12-02 23:10:38
I've tried disabling it by inserting: <meta name="viewport" content="width=320" /> into my HTML string, and a dozen variations of the above in the vain hope that I just screwed up the tag syntax... but nothing seems to stop UIWebView from scrolling horizontally. And yet there are apps that manage to do this (like MobileRSS), and presumably, since they haven't gotten rejected, they're not using private APIs. My version, a common solution: - (void)webViewDidFinishLoad:(UIWebView *)webView { [webView.scrollView setContentSize: CGSizeMake(webView.frame.size.width, webView.scrollView.contentSize

how to pass local html files using array in xcode

懵懂的女人 提交于 2019-12-02 22:29:09
问题 here i am trying for a application, when i click on the table view it will redirect to another page called details. there I have used a webview to dispaly the selected url value. here is my code -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:YES]; self.navigationItem.title=@"sample"; servicesArray=[[NSMutableArray alloc]init]; [servicesArray addObject:@"1"]; [servicesArray addObject:@"2"]; [servicesArray addObject:@"3"]; urlsArray=[[NSMutableArray alloc]init]; [urlsArray