Skip to content

Commit

Permalink
refactor: keep access level
Browse files Browse the repository at this point in the history
  • Loading branch information
nuomi1 committed Oct 22, 2024
1 parent 1625327 commit 011ef02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Sources/CollectionViewDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public final class CollectionViewDriver: NSObject {
/// A flow layout delegate object to receive forwarded events.
public weak var flowLayoutDelegate: UICollectionViewDelegateFlowLayout?

let _emptyViewProvider: EmptyViewProvider?
private let _emptyViewProvider: EmptyViewProvider?

private var _currentEmptyView: UIView?

// Avoiding a strong reference to prevent a possible retain cycle.
// This is typically the view controller that owns `self` (the driver).
// The caller is responsible for retaining this object for the lifetime of the driver.
private(set) weak var _cellEventCoordinator: CellEventCoordinator?
private weak var _cellEventCoordinator: CellEventCoordinator?

private(set) var _dataSource: DiffableDataSource

Expand Down Expand Up @@ -581,7 +581,7 @@ extension CollectionViewDriver: UICollectionViewDelegateFlowLayout {
extension CollectionViewDriver {
override public var debugDescription: String {
MainActor.assumeIsolated {
driverDebugDescription(self)
driverDebugDescription(self, self._emptyViewProvider, self._cellEventCoordinator)
}
}
}
10 changes: 7 additions & 3 deletions Sources/DebugDescriptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,19 @@ func driverOptionsDebugDescription(_ options: CollectionViewDriverOptions) -> St
}

@MainActor
func driverDebugDescription(_ driver: CollectionViewDriver) -> String {
func driverDebugDescription(
_ driver: CollectionViewDriver,
_ emptyViewProvider: EmptyViewProvider?,
_ cellEventCoordinator: CellEventCoordinator?
) -> String {
var output = ""
debugDescriptionBuilder(
elements: [
(.type(CollectionViewDriver.self), 0),
(.options(driver.options), 2),
(.viewModel(driver.viewModel), 2),
(.field(label: "emptyViewProvider", value: driver._emptyViewProvider), 2),
(.field(label: "cellEventCoordinator", value: driver._cellEventCoordinator), 2),
(.field(label: "emptyViewProvider", value: emptyViewProvider), 2),
(.field(label: "cellEventCoordinator", value: cellEventCoordinator), 2),
(.field(label: "scrollViewDelegate", value: driver.scrollViewDelegate), 2),
(.field(label: "flowLayoutDelegate", value: driver.flowLayoutDelegate), 2),
(.field(label: "view", value: driver.view), 2),
Expand Down

0 comments on commit 011ef02

Please sign in to comment.