Skip to content

Commit

Permalink
Don't pass reference of batchOperation to closure to keep behavior be…
Browse files Browse the repository at this point in the history
…fore c7c79c7
  • Loading branch information
HeEAaD committed Apr 25, 2024
1 parent 264ec44 commit 0002569
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions SectionKit/Sources/Utility/UICollectionView+Apply.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
}

Expand Down Expand Up @@ -108,7 +110,9 @@ extension UICollectionView {
if reloads.isNotEmpty {
reloadSections(IndexSet(reloads))
}
}, completion: { batchOperation.completion?($0) })
}, completion: { [completion = batchOperation.completion] in
completion?($0)
})
}
}
}

0 comments on commit 0002569

Please sign in to comment.