uiwebview

Call a method by clicking a button in a UIWebView

旧城冷巷雨未停 提交于 2019-12-03 15:00:47
I want to generate some HTML content and put this into a UIWebView. The HTML contains some buttons. Is it possible to define actions for these buttons? I want to call a method (e.g. firstButtonPressed) in my objective-c code when someone presses this button in the UIWebView. Thanks you for helping me. Just to follow up on this, it is possible, and not to difficult to connect HTML/javascript events to objective-c methods. Damien Berrigaud came up with a good example of how to do that by using file:// links // Map links starting with file:// // ending with #action // with the action of the

Video download from HTML + UIWebView

情到浓时终转凉″ 提交于 2019-12-03 14:17:35
In my new application i need to download video from different-different web sites, Say it is video downloader application. For this what i am planing is Searching html for .mp4 and .Flv url and then trying to downloading videos. There are many app already doing same http://itunes.apple.com/in/app/video-downloader-super-lite/id481701140?mt=8 What i am asking is, how can we download video? Any code or link or something. how this application work ? Any Help will really appreciate. what i needed is when you open a page in UIWebview Say you open "www.youtube.com" and select a video to play then it

UIScrollView with UIWebViews

£可爱£侵袭症+ 提交于 2019-12-03 14:10:55
问题 There seem to be many questions asked about this subject here on stackoverflow, but none of them touch on the updates made in 3.0. After mucking around for hours on end I finally found out, that nested scroll views (in my case web views inside a scroll view) are fully supported, however the example given at http://developer.apple.com/iphone/library/documentation/WindowsViews/Conceptual/UIScrollView_pg/Introduction/Introduction.html is pretty basic. I have a main scroll view with paging

Save PDF which is displayed by UIWebView locally

雨燕双飞 提交于 2019-12-03 14:08:47
问题 I have a UIViewController with an UIWebView which displays a pdf file depending which row was clicked before in an UITableView . Now I want to add a button for the user to save this pdf file locally for offline use. Then there is a second UITableView which should display the name of the saved pdf and by clicking on it another UIViewController appears and displays the saved pdf on a UIWebView offline. What would be a good way to start? Thanks 回答1: You can try this way: 1) Add a button to the

how does one check if UIWebView is empty or not

孤街醉人 提交于 2019-12-03 13:57:01
I need to check if a webview when completed loading has any content or not. What I require is simple. Its a small webview strip at the bottom of my pages (like an advert) I call NSURLRequest *request=[NSURLRequest requestWithURL:adURL]; [gWebView loadRequest:request]; I get the callback -(void)webViewDidFinishLoad:(UIWebView *)webView { But in my scenario the webview shall return empty and sometime it shall have data. I do not want to show the webview if my server php file returned nothing. How can I verify that I received an empty page in the callback (or any other way)? Jano If you are

_UIFallbackPresentationViewController

▼魔方 西西 提交于 2019-12-03 13:53:48
I keep getting the following error when I dismiss the dictionary that opens from tapping Define on the UIMenuController in a UIWebView on the iPhone:- Unbalanced calls to begin/end appearance transitions for <_UIFallbackPresentationViewController: 0x10ab9640>. And after this error, the UIMenuController stops showing up, in any UIWebView. Any ideas what's going on here? UPDATE: The error actually shows up when the dictionary view is opening, not when dismissing it. UPDATE 2: The error is app wide. Anywhere there is selectable text (i.e. webview, textview etc.) I can only use the define

UIWebView Delegate get MIME Type

这一生的挚爱 提交于 2019-12-03 13:48:04
问题 The UIWebView does not automatically support processing of Passbook .pkpass files. In this technical note, Apple recommend implementing a check via the UIWebViewDelegate methods to sniff out the MIME type and process it accordingly. To add passes using a UIWebView, implement the appropriate UIWebViewDelegate methods to identify when the view loads data with a MIME type of application/vnd.apple.pkpass However, I cannot find anything within the UIWebView Delegate Protocol Reference that is

UIWebView loading html5-Video EXC_BAD_ACCESS crash

℡╲_俬逩灬. 提交于 2019-12-03 13:34:49
in our iPad-App we are using an UIWebView to load different sites from one domain some of them with a hml5-Video. Sites without a Video do load perfectly. But when I'm loading a site containing htmlt5-video sometimes my app crashes during the loading-process of the UIWebView with EXC_BAD_ACCESS and sometimes it does not. Whenever such a crash occurs it seems to happen at the point where the Video-Player is added into the site. I did download the UICatalog-Example from Apple and just did change the Default-URL in the WebViewController-Class to a URL of a site containg html5-video. Same results

How to hide “Now playing url” in control center

霸气de小男生 提交于 2019-12-03 13:31:33
问题 I am trying to hide livestream urls that are playing in an UIWebView . When you play a livestream url and open control center (iOS) you see the url that is playing: . I would like to hide that with a HTML-based or xcode-based script. 回答1: You can control this information with the MPNowPlayingInfoCenter. The defaultCenter 's nowPlayingInfo dictionary controls what is displayed about the current audio track on the lock screen and command center. MPNowPlayingInfoCenter *infoCenter =

UIWebView webViewDidLoadFinish method not called

独自空忆成欢 提交于 2019-12-03 13:16:55
问题 I've been playing around with web views in swift this evening, but have run into a bit of an issue. For some reason I'm not able to get the webViewDidStartLoad or webViewDidFinishLoad methods to fire. In my storyboard, I have an outlet called webView linked to my UIWebView element. Is anyone able to help me with what I am doing wrong? This is my viewController.swift file: import UIKit class ViewController: UIViewController, UIWebViewDelegate { @IBOutlet var webView : UIWebView var url = NSURL