Class

WebBackForwardList

A WebBackForwardList object maintains a list of visited pages used to go back and forward to the most recent page. A WebBackForwardList object maintains only the list data—it does not perform actual page loads (in other words, it does not make any client requests). If you need to perform a page load, see the load(_:) method in WebFrame to find out how to do this.

Overview

Items are typically inserted in a back-forward list in the order they are visited. A WebBackForwardList object also maintains the notion of the current item (which is always at index 0), the preceding item (which is at index -1), and the following item (which is at index 1). The goBack() and goForward() methods move the current item backward or forward by one. The go(to:) method sets the current item to the specified item. All other methods that return WebHistoryItem objects do not change the value of the current item, they just return the requested item or items. You can also limit the number of history items stored in the back-forward list using capacity.

WebBackForwardList objects also control the number of pages cached. You can turn page caching off by setting the page cache size to 0 using the pageCacheSize() method, or limit the number of pages cached by passing a value greater than 0.

Symbols

Adding and Removing Items

func add(WebHistoryItem!)

Inserts an item into the back-forward list, immediately after the current item.

Moving Backward and Forward

func goBack()

Moves backward one item in the back-forward list.

func goForward()

Moves forward one item in the back-forward list.

func go(to: WebHistoryItem!)

Makes the specified item in the back-forward list the current item.

Querying the Back-Forward List

var backItem: WebHistoryItem!

The item that precedes the current item in the back-forward list.

var backListCount: Int32

The number of items that precede the current item in the back-forward list.

func back(withLimit: Int32)

Returns the items that precede the current item in the back-forward list, up to the specified number of items.

func contains(WebHistoryItem!)

Returns a Boolean value indicating whether the back-forward list contains the specified item.

var currentItem: WebHistoryItem!

The current item in the back-forward list.

func item(at: Int32)

Returns the item at the specified index in the back-forward list.

var forwardItem: WebHistoryItem!

The item that follows the current item in the back-forward list.

var forwardListCount: Int32

The number of items that follow the current item in the back-forward list.

func forwardList(withLimit: Int32)

Returns the items that follow the current item in the back-forward list, up to the specified number of items.

Page Caching

func pageCacheSize()

Returns the maximum number of pages that the receiver can cache.

Deprecated
func setPageCacheSize(Int)

Sets the maximum number of pages the receiver can cache.

Deprecated

Setting Attributes

var capacity: Int32

The maximum number of items that the back-forward list can contain.

Relationships

Inherits From

Conforms To