diff --git a/Example/Example/CollectionViewController.swift b/Example/Example/CollectionViewController.swift index 1617846..3feaf51 100644 --- a/Example/Example/CollectionViewController.swift +++ b/Example/Example/CollectionViewController.swift @@ -27,7 +27,7 @@ class CollectionViewController: UICollectionViewController { typealias HeaderViewFactory = TitledCollectionReusableViewFactory typealias Section = CollectionViewSection - var dataSourceProvider: CollectionViewDataSourceProvider? + var dataSourceProvider: CollectionViewDataSourceProvider? override func viewDidLoad() { diff --git a/Example/Example/TableViewController.swift b/Example/Example/TableViewController.swift index 6790788..03863ac 100644 --- a/Example/Example/TableViewController.swift +++ b/Example/Example/TableViewController.swift @@ -25,8 +25,7 @@ class TableViewController: UITableViewController { typealias Section = TableViewSection typealias CellFactory = TableViewCellFactory - var dataSourceProvider: TableViewDataSourceProvider? - + var dataSourceProvider: TableViewDataSourceProvider? override func viewDidLoad() { super.viewDidLoad() diff --git a/JSQDataSourcesKit/JSQDataSourcesKit/CollectionViewDataSourceProvider.swift b/JSQDataSourcesKit/JSQDataSourcesKit/CollectionViewDataSourceProvider.swift index fbbac4f..5dcdc8f 100644 --- a/JSQDataSourcesKit/JSQDataSourcesKit/CollectionViewDataSourceProvider.swift +++ b/JSQDataSourcesKit/JSQDataSourcesKit/CollectionViewDataSourceProvider.swift @@ -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. diff --git a/JSQDataSourcesKit/JSQDataSourcesKit/TableViewDataSourceProvider.swift b/JSQDataSourcesKit/JSQDataSourcesKit/TableViewDataSourceProvider.swift index c8d0d07..9bdec61 100644 --- a/JSQDataSourcesKit/JSQDataSourcesKit/TableViewDataSourceProvider.swift +++ b/JSQDataSourcesKit/JSQDataSourcesKit/TableViewDataSourceProvider.swift @@ -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 diff --git a/JSQDataSourcesKit/JSQDataSourcesKitTests/CollectionViewDataSourceTests.swift b/JSQDataSourcesKit/JSQDataSourcesKitTests/CollectionViewDataSourceTests.swift index 47b0949..f35b82d 100644 --- a/JSQDataSourcesKit/JSQDataSourcesKitTests/CollectionViewDataSourceTests.swift +++ b/JSQDataSourcesKit/JSQDataSourcesKitTests/CollectionViewDataSourceTests.swift @@ -71,7 +71,7 @@ class CollectionViewDataSourceTests: XCTestCase { typealias CellFactory = CollectionViewCellFactory typealias SupplementaryViewFactory = CollectionSupplementaryViewFactory typealias Section = CollectionViewSection - typealias Provider = CollectionViewDataSourceProvider + typealias Provider = CollectionViewDataSourceProvider let dataSourceProvider: Provider = CollectionViewDataSourceProvider(sections: allSections, cellFactory: factory, collectionView: fakeCollectionView) let dataSource = dataSourceProvider.dataSource diff --git a/JSQDataSourcesKit/JSQDataSourcesKitTests/CollectionViewFakes.swift b/JSQDataSourcesKit/JSQDataSourcesKitTests/CollectionViewFakes.swift index 10c1fd4..5ce68e5 100644 --- a/JSQDataSourcesKit/JSQDataSourcesKitTests/CollectionViewFakes.swift +++ b/JSQDataSourcesKit/JSQDataSourcesKitTests/CollectionViewFakes.swift @@ -31,7 +31,7 @@ typealias SupplementaryViewFactory = CollectionSupplementaryViewFactory -typealias Provider = CollectionViewDataSourceProvider +typealias Provider = CollectionViewDataSourceProvider struct FakeCollectionModel: Equatable, CustomStringConvertible {