Skip to content
This repository was archived by the owner on Apr 15, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Example/Example/CollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CollectionViewController: UICollectionViewController {
typealias HeaderViewFactory = TitledCollectionReusableViewFactory<CellViewModel>
typealias Section = CollectionViewSection<CellViewModel>

var dataSourceProvider: CollectionViewDataSourceProvider<CellViewModel, Section, CellFactory, HeaderViewFactory>?
var dataSourceProvider: CollectionViewDataSourceProvider<Section, CellFactory, HeaderViewFactory>?


override func viewDidLoad() {
Expand Down
3 changes: 1 addition & 2 deletions Example/Example/TableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class TableViewController: UITableViewController {

typealias Section = TableViewSection<CellViewModel>
typealias CellFactory = TableViewCellFactory<UITableViewCell, CellViewModel>
var dataSourceProvider: TableViewDataSourceProvider<CellViewModel, Section, CellFactory>?

var dataSourceProvider: TableViewDataSourceProvider<Section, CellFactory>?

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ A `CollectionViewDataSourceProvider` is responsible for providing a data source
- Adding, removing, or reloading sections as the provider's `sections` are modified
*/
public final class CollectionViewDataSourceProvider <
Item,
SectionInfo: CollectionViewSectionInfo,
CellFactory: CollectionViewCellFactoryType,
SupplementaryViewFactory: CollectionSupplementaryViewFactoryType
where SectionInfo.Item == Item, CellFactory.Item == Item, SupplementaryViewFactory.Item == Item>: CustomStringConvertible {
where CellFactory.Item == SectionInfo.Item, SupplementaryViewFactory.Item == SectionInfo.Item>: CustomStringConvertible {

/// The type of elements for the data source provider.
public typealias Item = SectionInfo.Item

// MARK: Properties

/// The sections in the collection view.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ A `TableViewDataSourceProvider` is responsible for providing a data source objec
- Adding, removing, or reloading cells and sections as the provider's `sections` are modified.
*/
public final class TableViewDataSourceProvider <
Item,
SectionInfo: TableViewSectionInfo,
CellFactory: TableViewCellFactoryType
where SectionInfo.Item == Item, CellFactory.Item == Item>: CustomStringConvertible {
where CellFactory.Item == SectionInfo.Item>: CustomStringConvertible {

/// The type of elements for the data source provider.
public typealias Item = SectionInfo.Item

// MARK: Properties

/// The sections in the table view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CollectionViewDataSourceTests: XCTestCase {
typealias CellFactory = CollectionViewCellFactory<FakeCollectionCell, FakeCollectionModel>
typealias SupplementaryViewFactory = CollectionSupplementaryViewFactory<FakeCollectionSupplementaryView, FakeCollectionModel>
typealias Section = CollectionViewSection<FakeCollectionModel>
typealias Provider = CollectionViewDataSourceProvider<FakeCollectionModel, Section, CellFactory, SupplementaryViewFactory>
typealias Provider = CollectionViewDataSourceProvider<Section, CellFactory, SupplementaryViewFactory>

let dataSourceProvider: Provider = CollectionViewDataSourceProvider(sections: allSections, cellFactory: factory, collectionView: fakeCollectionView)
let dataSource = dataSourceProvider.dataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typealias SupplementaryViewFactory = CollectionSupplementaryViewFactory<FakeColl

typealias Section = CollectionViewSection<FakeCollectionModel>

typealias Provider = CollectionViewDataSourceProvider<FakeCollectionModel, Section, CellFactory, SupplementaryViewFactory>
typealias Provider = CollectionViewDataSourceProvider<Section, CellFactory, SupplementaryViewFactory>


struct FakeCollectionModel: Equatable, CustomStringConvertible {
Expand Down