Fix retain cycle in toolbar

This commit is contained in:
Shadowfacts 2021-09-28 21:03:23 -04:00
parent c391a274e1
commit afa2a7b771
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ class ToolbarView: UIView {
if #available(iOS 14.0, *) {
let back = navigator.backStack.suffix(5).enumerated().reversed().map { (index, url) -> UIAction in
let backCount = min(5, navigator.backStack.count) - index
return UIAction(title: urlForDisplay(url)) { (_) in
return UIAction(title: urlForDisplay(url)) { [unowned self] (_) in
self.navigator.back(count: backCount)
}
}
@ -161,7 +161,7 @@ class ToolbarView: UIView {
let forward = navigator.forwardStack.prefix(5).enumerated().map { (index, url) -> UIAction in
let forwardCount = index + 1
return UIAction(title: urlForDisplay(url)) { (_) in
return UIAction(title: urlForDisplay(url)) { [unowned self] (_) in
self.navigator.forward(count: forwardCount)
}
}