Skip to content
This repository was archived by the owner on Sep 25, 2021. It is now read-only.

Update the visitable titles example code #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,15 @@ By default, Turbolinks for iOS sets your Visitable view controller’s `title` p
If you want to customize the title or pull it from another element on the page, you can implement the `visitableDidRender` method on your Visitable:

```swift
func visitableDidRender() {
override func visitableDidRender() {
title = formatTitle(visitableView.webView?.title)
}

func formatTitle(title: String) -> String {
func formatTitle(title: String?) -> String {
guard let title = title else {
return "Default Title"
}

// ...
}
```
Expand Down