uiwebview

Get notified about a page change in UIWebView

旧时模样 提交于 2019-11-29 07:57:23
问题 I'm curious if there's a way to detect a change of the displayed website inside a UIWebView . In an app I'm working on we're using a UIWebView to present a part of the functionality which are basically a few steps the user needs to follow. However, the will be a specific page at the end of these steps that I need to identify and after which the app needs to display a different view. Unfortunately the UIWebViewDelegate doesn't seem to do the trick. 回答1: If the user steps are separated on

Using a UIWebView, can I use a custom font?

五迷三道 提交于 2019-11-29 07:43:33
问题 I've seen all the talk on the web about the difficulty of using a custom font in iPhone OS. Is it possible, to load a font from within my bundle into the UIWebView component? EDIT: I saw it in the app called "Omer" by "Rusty Brick"... It seems to be a web view, because I see a delay and during the loading delay the custom area is white. What other component could this have been? EDIT2: I contacted Rusty Brick. They told me which font it was. A standard font. 回答1: It is possible to load custom

How to block Javascript alert|confirm|promt in UIWebView before render completed?

假如想象 提交于 2019-11-29 07:18:21
There are multiple questions on SO already addressing similar issues but none answers my exact type of question. Most of the answers involves running a JS snippet and overloading the alert method as such: window.alert = function() {}; The problem I am having is that the webpage loaded (which I have no control over the content) opens an alert before the rendering of the whole page completes. Because of this I cannot use the: - (void)webViewDidFinishLoad:(UIWebView *)webView delegate method to run the JS snippet. In addition running the same snippet in - (void)webViewDidStartLoad:(UIWebView *

Cross-Platform Way of Creating Safari Webarchives

痞子三分冷 提交于 2019-11-29 06:38:41
I've been searching around and haven't found any reference to tools that can create Safari's webarchive format. Does anyone have pointers to code for creating this format, or at least a format reference documentation? Ideally I'd like to build a tool that takes a directory and splits out a webarchive, for loading into a iPhone. To expand on what Ben said: CFLite (the cross-platform open-source subset of Core Foundation) ships with a plist parser. If you can link against that, it should be quite simple to work with .webarchive files, which are simply property lists that concatenate all files

Facebook-ios-sdk with embedded UIWebView

↘锁芯ラ 提交于 2019-11-29 06:27:43
问题 I'm working with the new facebook-ios-sdk and have successfully integrated the api into my native app. I am able to authenticate a user and properly setup permissions using a popup dialog with the ios-sdk classes. For a portion of my app I need to use the facebook connection within a UIWebView , using javascript and html to process data within the webview. Given that the user is already logged in and authenticated via the above routine, I would have assumed that the UIWebView would share

How to set scroll position on uiwebview

房东的猫 提交于 2019-11-29 06:25:22
问题 I want to go to specify line on my uiwebview loaded. I tried [webView stringByEvaluatingJavaScriptFromString:@"window.scrollTo(0.0, 100.0)"]; but it's not working. My webview still start with top of the page. I just wonder its because I load the UIWebview inside UIView . Check my code below on my UIView : - (void)loadView { webview = [[WebViewDetail alloc]initWithFrame:[UIScreen mainScreen].applicationFrame]; //initialize a mainView is a UIWebVIew webview.managedObjectContext = self

How do I share files using share sheet in IOS?

冷暖自知 提交于 2019-11-29 06:01:50
问题 I want to share some files I have locally in my App using Share Sheet functionality in iPhone. I display the file in a UIWebview and when the user click the share sheet, I want to show options (email, whats app etc ) to share the file displayed on the UIWebView . I know that we can use func displayShareSheet(shareContent:String) { let activityViewController = UIActivityViewController(activityItems: [shareContent as NSString], applicationActivities: nil) presentViewController

Frame load interrupted error while loading a word document in UIWebView

微笑、不失礼 提交于 2019-11-29 06:00:43
I want to load a word document using UIWebView. I used the code provided in http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html to load the document. But not all the documents load successfully. Sometimes I get an error Error Domain=WebKitErrorDomain Code=102 UserInfo=0x145bc10 "Frame load interrupted" The error seems to be very sporadic and I get this error only for some documents. However the same document loads correctly in mail.app. What am I missing? The reason was, the file I tried to load doesn't contain a extension. I was purposely removing the file extension (.doc and .ppt

UIWebView Movie Player getting dismissed iOS 6 bug

醉酒当歌 提交于 2019-11-29 05:40:14
问题 When I try to initiate a video to play (via YouTube) in a UIWebView , the video opens, then the debugger says: [MPAVController] Autoplay: Enabling autoplay [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1) Here's a similar question: MPMoviePlayerController stops playing after a few seconds My only problem is that with a UIWebView , I can't set up an MPMoviePlayerController to prepareToPlay . At least not as far as my knowledge goes. If anyone can help

How to access image resource in asset catalog from UIWebView (or WKWebView)

江枫思渺然 提交于 2019-11-29 05:39:34
We have a local html to show in UIWebView . And there, we want to show images that are defined in Asset Catalog. I know that we can do similar thing if we had the image flat in the main bundle. The code snippet would be like this. webView.loadHTMLString("<img src='target_image.png'/>", baseURL: NSBundle.mainBundle().bundleURL) However, I am not sure what I can specify for "target_image.png" if the png file is packaged in asset catalog. (Furthermore, we want to specify pdf to take advantage of vector image support in Xcode 6) Does anybody have any idea how to achieve this? Since the asset