Skip to content

Commit

Permalink
update better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinChangCC committed May 22, 2024
1 parent 9e1437f commit cbfbfe1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class NamesSectionController: ListSectionController<
layout.boundarySupplementaryItems = []
}
return .compositionalLayout(
.init(layoutSection: { _ in layout })
.init { _ in layout }
)
}

Expand Down
6 changes: 3 additions & 3 deletions SectionKit/Sources/SectionController/SectionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public struct CompositionalLayoutProvider {
/// - Parameters:
/// - layoutEnvironment: the environment value for the layout
/// - Returns: The layout for the section
var layoutSection: (_ layoutEnvironment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection
var layoutSectionProvider: (_ layoutEnvironment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection

public init(
layoutSection: @escaping (any NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection
layoutSectionProvider: @escaping (any NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection
) {
self.layoutSection = layoutSection
self.layoutSectionProvider = layoutSectionProvider
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final public class SectionKitCompositionalLayout: UICollectionViewCompositionalL
assertionFailure("Please set the layout provider with `CompositionalLayoutProvider`")
return .empty
}
return provider.layoutSection(environment)
return provider.layoutSectionProvider(environment)
}
sections = { [weak self] in
self?.sections?() ?? []
Expand Down

0 comments on commit cbfbfe1

Please sign in to comment.