Questions tagged [uiwebview]

A class used to display web content from within an iOS application. Note that UIWebView is deprecated since iOS 8, it is recommended by Apple to use WKWebView instead.

UIWebView is used to render HTML content in iOS () applications (including accompanying CSS and JavaScript). UIWebView is effectively a miniature web browser that you can embed within your app. The user can view a web page (both local or from the Internet) in the app itself instead of launching the separate Safari app. UIWebView is available in iOS 2.0 and later.

Set the delegate property for the UIWebView to an object conforming to the UIWebViewDelegate protocol if you want to track the loading of web content from your app.

Note that UIWebView is deprecated since iOS 8, it is recommended by Apple to use WKWebView instead.

Resources:

10713 questions
113
votes
14 answers

Get current URL of UIWebView

I already tried getting the current URL of my UIWebView with: webview.request.URL. Unfortunately the NSURL was empty. Anything wrong here? I am working with Xcode 3.2.2 beta 5. The code above should be executed in the UIWebView delegate…
danielreiser
  • 5,292
  • 5
  • 31
  • 43
107
votes
6 answers

Enable zooming/pinch on UIWebView

I have an UIWebView with a pdf-file. It works fine. But how can i enable zooming on the pdf-file?
David
  • 1,071
  • 2
  • 7
  • 4
106
votes
10 answers

Can we open pdf file using UIWebView on iOS?

Can we open the pdf file from UIWebView?
MohammedYakub M.
  • 2,893
  • 5
  • 31
  • 42
105
votes
9 answers

iOS JavaScript bridge

I'm working on an app where I'm going to use both HTML5 in UIWebView and native iOS framework together. I know that I can implement communication between JavaScript and Objective-C. Are there any libraries that simplify implementing this…
andr111
  • 2,982
  • 11
  • 35
  • 45
96
votes
23 answers

ITMS-90809: Deprecated API Usage -- Apple will stop accepting submissions of apps that use UIWebView APIs

Yesterday, I uploaded my App to TestFlight and after a while Apple sent me this warning: ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See…
Nick
  • 1,434
  • 1
  • 10
  • 19
96
votes
12 answers

WKWebView in Interface Builder

It seems that the IB object templates in XCode 6 beta are still creating old-style objects (UIWebView for iOS and WebView for OSX). Hopefully Apple will update them for the modern WebKit, but until then, what is the best way to create WKWebViews in…
Adam Fox
  • 3,438
  • 5
  • 23
  • 20
94
votes
18 answers

Disable Scroll on a UIWebView allowed?

I have to show a web article with a UITableView under the article. The only option I found was to display the article in a UIWebView in the tableView header. In order to do that I have to get the height of the webView content and I have to disable…
jsaddour
  • 941
  • 1
  • 6
  • 3
92
votes
7 answers

Javascript console.log() in an iOS UIWebView

When writing a iPhone / iPad app with a UIWebView, the console isn't visible. this excellent answer shows how to trap errors, but I would like to use the console.log() as well.
TinkerTank
  • 5,685
  • 2
  • 32
  • 41
91
votes
5 answers

How to delete all cookies of UIWebView?

In my application, I have a UIWebview that loads linkedin auth page for login. When user logs in, cookies saves into the application. My app has a logout button that is not related to linkedin login. So when user clicks on this button, he logs off…
Vaibhav Saran
  • 12,848
  • 3
  • 65
  • 75
91
votes
18 answers

iOS 7 Status bar with Phonegap

In iOS 7, Phonegap applications will appear underneath the status bar. This can make it difficult to click on buttons/menus that have been placed at the top of the screen. Is there someone who knows a way to fix this status bar issue on iOS 7 in a…
Luddig
  • 2,809
  • 3
  • 20
  • 23
85
votes
16 answers

How to display .svg image using swift

I have a .svg image file I want to display in my project. I tried using UIImageView, which works for the .png & .jpg image formats, but not for the .svg extension. Is there any way to display a .svg image using UIWebView or UIImageView ?
Priyanka Kanse
  • 1,051
  • 1
  • 15
  • 27
84
votes
14 answers

Stop word-wrap dividing words

body { word-wrap: break-word;} I've been using that code (above) to fit the text in the body into it's container. However what I don't like about it, is that it breaks up words. Is there another way where it will not break up words and only line…
Joshua
  • 15,200
  • 21
  • 100
  • 172
83
votes
13 answers

Load local html into UIWebView using swift

This one is driving me crazy early this morning. I want to load some local html into a web view: class PrivacyController: UIViewController { @IBOutlet weak var webView:UIWebView! override func viewDidLoad() { let url =…
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
83
votes
6 answers

What does Unrestricted Web Access mean in iTunes Connect

When you are submitting your app to Apple app store, there is a section named "Rating" where you should rate your content based on the chart and identify how frequently the content appears. There is one option called "Unrestricted web access" which…
81
votes
14 answers

Getting all cookies from WKWebView

while getting cookies from UIWebView seems straightforward by using NSHTTPCookieStorage.sharedHTTPCookieStorage(), it seems WKWebView stores the cookies somewhere else. I did some research, and I was able to get some cookies from the grabbing it…
aporat
  • 5,922
  • 5
  • 32
  • 54