<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebHistoryItem/init(urlString:title:lastVisitedTimeInterval:)-5amr",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WebHistoryItem(im)initWithURLString:title:lastVisitedTimeInterval:"
  },
  "title" : "init(urlString:title:lastVisitedTimeInterval:)"
}
-->

# init(urlString:title:lastVisitedTimeInterval:)

Initializes the receiver with a URL,`URLString`, a title specified by `title` and the last time this item was visited specified by `time` title, and time last visited.

```
init!(urlString URLString: String!, title: String!, lastVisitedTimeInterval time: TimeInterval)
```

## Discussion

WebKit normally creates WebHistoryItem objects for you but on occasion you might want to create an item and add it to the WebBackForwardList yourself. Note that when an instance is first initialized the strings returned by [`urlString`](/documentation/WebKit/WebHistoryItem/urlString) and [`originalURLString`](/documentation/WebKit/WebHistoryItem/originalURLString) are the same.

## See Also

  [WebKit Objective-C Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/DisplayWebContent/DisplayWebContent.html#//apple_ref/doc/uid/10000164i)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)