Mac Developer Library

Developer

WebKit Framework Reference WebHistoryItem Class Reference

Options
Deployment Target:

On This Page
Language:

WebHistoryItem

WebHistoryItem objects encapsulate information about visiting a page so that users can return to that page. WebHistory and WebBackForwardList objects manage lists of WebHistoryItem objects. WebHistoryItem objects are created and added to these lists automatically when loading pages, so you do not need to create WebHistoryItem objects directly.

  • The string representation of the URL for the receiver’s page. (read-only)

    Declaration

    Swift

    var URLString: String! { get }

    Objective-C

    @property(nonatomic, readonly, copy) NSString *URLString

    Discussion

    This URL may differ from the original URL if the page was, for example, redirected to a new location.

    Availability

    Available in OS X v10.2 and later.

  • The string representation of the original URL for the receiver’s page. (read-only)

    Declaration

    Swift

    var originalURLString: String! { get }

    Objective-C

    @property(nonatomic, readonly, copy) NSString *originalURLString

    Availability

    Available in OS X v10.2 and later.

    See Also

    URLString

  • The receiver’s original page title. (read-only)

    Declaration

    Swift

    var title: String! { get }

    Objective-C

    @property(nonatomic, readonly, copy) NSString *title

    Discussion

    The title returned comes from the title HTML tag for HTML documents.

    Availability

    Available in OS X v10.2 and later.

    See Also

    alternateTitle

  • An alternate title that may be used in place of the receiver’s page title.

    Declaration

    Swift

    var alternateTitle: String!

    Objective-C

    @property(nonatomic, copy) NSString *alternateTitle

    Discussion

    This method returns nil if no alternate title exists.

    Availability

    Available in OS X v10.2 and later.

  • icon icon Property

    The icon for the receiver’s page, or nil if none exists. (read-only)

    Declaration

    Swift

    var icon: NSImage! { get }

    Objective-C

    @property(nonatomic, readonly, strong) NSImage *icon

    Availability

    Available in OS X v10.2 and later.

  • The last time and date the receiver’s page was visited. (read-only)

    Declaration

    Swift

    var lastVisitedTimeInterval: NSTimeInterval { get }

    Objective-C

    @property(nonatomic, readonly) NSTimeInterval lastVisitedTimeInterval

    Discussion

    The interval is from a reference date as determined by NSDate.

    Availability

    Available in OS X v10.2 and later.

  • Posted by a WebHistoryItem object when the value of the history item’s title, alternate title, URL strings, or last visited interval changes.

    This notification does not contain a userInfo dictionary.

    Declaration

    Swift

    let WebHistoryItemChangedNotification: String

    Import Statement

    Objective-C

    @import WebKit;

    Swift

    import WebKit

    Availability

    Available in OS X v10.2 with Safari 1.0 and later.

    Available in OS X v10.2.7 and later.