Skip to content

Commit 133be72

Browse files
committed
Changed apply for BatchUpdate in TableView from private to public (it was the only method with access-level of private). and added default implementation for indexPathTransform
1 parent 2ac614e commit 133be72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Diff+UIKit.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ public extension UITableView {
125125
)
126126
}
127127

128-
private func apply(
128+
public func apply(
129129
_ diff: ExtendedDiff,
130130
deletionAnimation: UITableViewRowAnimation = .automatic,
131131
insertionAnimation: UITableViewRowAnimation = .automatic,
132-
indexPathTransform: (IndexPath) -> IndexPath
132+
indexPathTransform: (IndexPath) -> IndexPath = { $0 }
133133
) {
134134
let update = BatchUpdate(diff: diff, indexPathTransform: indexPathTransform)
135135

@@ -316,7 +316,7 @@ public extension UICollectionView {
316316
public func apply(
317317
_ diff: ExtendedDiff,
318318
completion: ((Bool) -> Swift.Void)? = nil,
319-
indexPathTransform: @escaping (IndexPath) -> IndexPath
319+
indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 }
320320
) {
321321
performBatchUpdates({
322322
let update = BatchUpdate(diff: diff, indexPathTransform: indexPathTransform)

0 commit comments

Comments
 (0)