Skip to content

Commit 1f169d7

Browse files
committed
Avoid retain cycles in animations
1 parent 15795b1 commit 1f169d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/DashboardViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ private extension DashboardViewController {
189189

190190
func showHeader(animated: Bool) {
191191
if animated {
192-
animateHeaderVisibility {
193-
self.showHeaderWithoutAnimation()
192+
animateHeaderVisibility { [weak self] in
193+
self?.showHeaderWithoutAnimation()
194194
}
195195
} else {
196196
showHeaderWithoutAnimation()
@@ -199,8 +199,8 @@ private extension DashboardViewController {
199199

200200
func hideHeader(animated: Bool) {
201201
if animated {
202-
animateHeaderVisibility {
203-
self.hideHeaderWithoutAnimation()
202+
animateHeaderVisibility { [weak self] in
203+
self?.hideHeaderWithoutAnimation()
204204
}
205205
} else {
206206
hideHeaderWithoutAnimation()

0 commit comments

Comments
 (0)