Skip to content

UIWebViewController

James Barrow edited this page Jan 29, 2017 · 4 revisions

UIWebViewController

A subclass of BaseWebViewController that wraps a UIWebView in a view controller.

url

The URL of the current page.

Declaration

Swift

public override var url: URL?

---

<br>

### loading
Returns true if the web view is currently loading, false if not.

**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
public override var loading: Bool


stopLoading()

Stops the web view from being loaded any more.

Declaration

Swift

public override func stopLoading()


---

<br>

### viewDidLoad()


**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
public override func viewDidLoad()


## Action Methods

refreshButtonPressed(_:)

Refrshes the web view when the refresh button is pressed in the toolbar.

Declaration

Swift

override func refreshButtonPressed(_ sender: AnyObject?)


**Parameters**
<table>
<tr><td> `sender` </td><td> The bar button item pressed. </td></tr>
<table>

---

<br>

### backButtonPressed(_:)
Requests the web view go back a page.

**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
override func backButtonPressed(_ sender: AnyObject?)

Parameters

`sender` The bar button item pressed.


forwardButtonPressed(_:)

Requests the web view go forward a page.

Declaration

Swift

override func forwardButtonPressed(_ sender: AnyObject?)


**Parameters**
<table>
<tr><td> `sender` </td><td> The bar button item pressed. </td></tr>
<table>

---


<br>
## UIWebViewDelegate Methods  <br>

### webViewDidStartLoad(_:)


**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
public func webViewDidStartLoad(_ webView: UIWebView)


webViewDidFinishLoad(_:)

Declaration

Swift

public func webViewDidFinishLoad(_ webView: UIWebView)


---

<br>

### webView(_:didFailLoadWithError:)


**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
public func webView(_ webView: UIWebView, didFailLoadWithError error: Error)


## Load Methods

loadBaseURL()

Creates a URL string, appending http:// if the URL string does not already have it as a prefix and then loads the page in the web view.

Declaration

Swift

override func loadBaseURL() -> String


**Return Value**  
The base URL string.

---

<div class="footer" align="center"><sub>Built with <a href="https://github.com/Baza207/LittleHedgehogDocs" target="_blank">Little Hedgehog Docs</a> by <a href="mailto:[email protected]" target="_blank">James Barrow</a> - <a href="http://pigonahill.com" target="_blank">Pig on a Hill Productions</a>.</sub></div>