From 00025694e8fa5597e83ed6bb7729b920e7e29510 Mon Sep 17 00:00:00 2001 From: Steffen Matthischke Date: Wed, 24 Apr 2024 15:53:56 +0200 Subject: [PATCH] Don't pass reference of batchOperation to closure to keep behavior before c7c79c7808037ec56555e59a373f9339e634457c --- SectionKit/Sources/Utility/UICollectionView+Apply.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SectionKit/Sources/Utility/UICollectionView+Apply.swift b/SectionKit/Sources/Utility/UICollectionView+Apply.swift index ab250cf4..cdb4b05c 100644 --- a/SectionKit/Sources/Utility/UICollectionView+Apply.swift +++ b/SectionKit/Sources/Utility/UICollectionView+Apply.swift @@ -54,7 +54,9 @@ extension UICollectionView { if reloads.isNotEmpty { reloadItems(at: reloads.map { IndexPath(item: $0, section: section) }) } - }, completion: { batchOperation.completion?($0) }) + }, completion: { [completion = batchOperation.completion] in + completion?($0) + }) } } @@ -108,7 +110,9 @@ extension UICollectionView { if reloads.isNotEmpty { reloadSections(IndexSet(reloads)) } - }, completion: { batchOperation.completion?($0) }) + }, completion: { [completion = batchOperation.completion] in + completion?($0) + }) } } }