uiwebview

How to save UIWebView content for offline display?

懵懂的女人 提交于 2019-12-12 08:13:58
问题 I'm using Xcode 7.2 and Swift to create an iOS app, on this app I display the content of my website, however if I was offline the content will not be shown. So I want to cache the webpage and display for offline. After I declared everything I'm using the following code : var URLPATH="http://google.com" let requestURL = NSURL(string: URLPATH) let request = NSURLRequest(URL: requestURL!) WB.loadRequest(request) 回答1: HTML to Data if let url = URL(string: urlString) { person.setValue(try? Data

PDF in UIWebView

↘锁芯ラ 提交于 2019-12-12 08:13:07
问题 I am creating a magazine app. I am displaying each page of my magazine in a UIWebView. The webview doesn't fill the screen with the PDF though. There is a border around it. How can I display it fullscreen? 回答1: I have not tried this with a UIWebView, but you may be able to do something like this to programatically position the border so that it's offscreen: CGRect frame = webView.frame; // you may need to modify the 5 and 10 below to match the size of the PDF border frame.origin.x = frame

UIWebView not freeing all live bytes using ARC

浪尽此生 提交于 2019-12-12 07:50:01
问题 I am currently building a navigation controller app in iOS 5.1 that uses ARC. I often need to display webpages and I have made a web viewer that is just a UIWebView with some custom content around the sides. When the user is finished looking at the page they hit the back button which should release all of the memory associated with the custom web viewer. My problem is that all of the memory does not appear to be released when the back button is hit. I have built a toy app (on github) that is

Embed video in html file loaded in UIWebView from Documents folder of application

前提是你 提交于 2019-12-12 07:47:35
问题 I have an html file named videoplay.html with following content <!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> <p> This is demo html file for playing movie file embedded. </p> <p> <video controls> <source src="myvideoname.mov"> </video> </p> </body> </html> while Using following code (Loading from application bundle) It loads html content and shows movie and able to play movie file. NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]; NSString *path

How to restrict adult content on UIWebview?

折月煮酒 提交于 2019-12-12 06:09:50
问题 I am working on an app which is specifically designed for kids .So we are giving some search option for the kids through google search engine and making it sure that search should be safe which we are doing by adding &safe=activate in the url. This is working fine and the search content is restricted.Now user enters another search engine in google say bing and open it on UIWebview . So like google it is also restricting the adult content but asking permission of age limit.If kid agrees that

Controlling website within Xcode/ Swift UIWebView

烈酒焚心 提交于 2019-12-12 05:48:15
问题 I have created a very simple app which directs the user to a web app... one of the pages within the app allows you to search store stock for various different stores (store number entered manually or the nearest store located automatically) and then asks the user to enter the appropriate barcode... within the app I have therefore added a barcode scanner (a separate view controller) which captures the barcode and then returns to the uiwebview... but how can I automatically enter that barcode

Continous integration for iphone xcode

依然范特西╮ 提交于 2019-12-12 05:38:48
问题 I would like to implement continous integration on an iphone. I've read that I can use HUDSON, and would like an opinion if this this the best option. Continuous Integration for Xcode projects? The cruise control option also looks interesting. http://blog.jeffreyfredrick.com/2008/11/27/continuous-integration-for-iphonexcode-projects/ Integration testing will be done by http://code.google.com/p/uispec/ Is this a valid choice. 回答1: Apple just released to OSX Mavericks a new continuous

YouTube embedded video displaying wrong size

吃可爱长大的小学妹 提交于 2019-12-12 05:32:21
问题 I have embedded a youtube video in a UIWebView for display in my app. Here's the code for that: func loadVideo(){ if let youtubeCode = exerciseYoutubeCode { guard !youtubeCode.isEmpty else { return } exerciseVideoWebView.isHidden = false exerciseVideoWebView.allowsInlineMediaPlayback = true exerciseVideoWebView.scrollView.isScrollEnabled = false exerciseVideoWebView.scrollView.bounces = false exerciseVideoWebView.loadHTMLString("<html><head><style>body{margin:0px}</style></head><body><iframe

Inappropriate scaling factor when editing PDF and displaying image in UIWebView

こ雲淡風輕ζ 提交于 2019-12-12 05:19:22
问题 I'm struggling with PDF editing so I'm starting with naive code trying to achieve the following : Display a PDF bundled with app Click on screen where I want to add my image (Signature for example) Reload the webview with the edited PDF Here is my code on github : https://github.com/HRiffiod/PDFSignature.git The problem is that my image does not display at the right position in the edited PDF. It is not random, but the farther I get from the (0,0) coordinates, the bigger the deviation, that's

Publish UIWebview via Facebook connect

橙三吉。 提交于 2019-12-12 05:13:47
问题 I am using fbConnect in my Cocoa Touch application. I have UIWebview on my view, and I want to publish the UIWebview's context (its only text) to FaceBook. How should I change the FBStream to publish my UIWebview? FBStreamDialog* dialog2 = [[[FBStreamDialog alloc] init] autorelease]; dialog2.delegate = self; dialog2.userMessagePrompt = @"Share Ghazals on your wall"; dialog2.attachment = @"{\"name\":\"Hafez Application for iPhone\"," "\"href\":\"http://itunes.apple.com/us/app/divan-of-hafez