Fix retain cycle in toolbar
This commit is contained in:
parent
c391a274e1
commit
afa2a7b771
|
@ -153,7 +153,7 @@ class ToolbarView: UIView {
|
||||||
if #available(iOS 14.0, *) {
|
if #available(iOS 14.0, *) {
|
||||||
let back = navigator.backStack.suffix(5).enumerated().reversed().map { (index, url) -> UIAction in
|
let back = navigator.backStack.suffix(5).enumerated().reversed().map { (index, url) -> UIAction in
|
||||||
let backCount = min(5, navigator.backStack.count) - index
|
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)
|
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 forward = navigator.forwardStack.prefix(5).enumerated().map { (index, url) -> UIAction in
|
||||||
let forwardCount = index + 1
|
let forwardCount = index + 1
|
||||||
return UIAction(title: urlForDisplay(url)) { (_) in
|
return UIAction(title: urlForDisplay(url)) { [unowned self] (_) in
|
||||||
self.navigator.forward(count: forwardCount)
|
self.navigator.forward(count: forwardCount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue