{"id":19190825,"url":"https://github.com/flocked/advancedcollectiontableview-ios","last_synced_at":"2026-03-11T14:38:07.499Z","repository":{"id":223745564,"uuid":"761398094","full_name":"flocked/AdvancedCollectionTableView-iOS","owner":"flocked","description":"Extended UICollectionView, UITableView, Diffable Data Sources, Cells and more.","archived":false,"fork":false,"pushed_at":"2024-02-22T01:21:23.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T15:16:46.546Z","etag":null,"topics":["ios","swift","uicollectionview","uicollectionviewcell","uicollectionviewdiffabledatasource","uitableview","uitableviewcell","uitableviewdiffabledatasource"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flocked.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-21T19:48:21.000Z","updated_at":"2025-04-10T11:30:28.000Z","dependencies_parsed_at":"2024-11-09T11:36:03.780Z","dependency_job_id":"93cc99ee-6d5c-4a82-9a7c-a8a145adafc3","html_url":"https://github.com/flocked/AdvancedCollectionTableView-iOS","commit_stats":null,"previous_names":["flocked/advancedcollectiontableview-ios"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/flocked/AdvancedCollectionTableView-iOS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FAdvancedCollectionTableView-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FAdvancedCollectionTableView-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FAdvancedCollectionTableView-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FAdvancedCollectionTableView-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flocked","download_url":"https://codeload.github.com/flocked/AdvancedCollectionTableView-iOS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FAdvancedCollectionTableView-iOS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30384106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T14:10:17.325Z","status":"ssl_error","status_checked_at":"2026-03-11T14:09:37.934Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","swift","uicollectionview","uicollectionviewcell","uicollectionviewdiffabledatasource","uitableview","uitableviewcell","uitableviewdiffabledatasource"],"created_at":"2024-11-09T11:35:53.158Z","updated_at":"2026-03-11T14:38:07.480Z","avatar_url":"https://github.com/flocked.png","language":"Swift","readme":"# Advanced UICollectionView \u0026 UITableView\n\nA framework for `UICollectionView` and `UITableView` that provides:\n\n- Extended collection and table view diffable data sources with handlers for selecting, reordering, focusing and editing cells and additional functionality.\n- Table view cell registration similar to `UICollectionView.CellRegistration`.\n- Additional extensions for `UICollectionView` and `UITableView`.\n\n## UICollectionViewDiffableDataSource \u0026 TableViewDiffableDataSource\n\n### Handlers\n\nThere are handlers for selecting, reordering, focusing and editing cells.\n\nExamples of some of the included handlers:\n\n```swift\n// Handler that gets called when the user did select an item.\ndiffableDataSource.selectionHandlers.didSelect = { itemIdentifier in\n\n}\n\n// Handler that gets called when an item/cell is about to be shown.\ndiffableDataSource.displayingHandlers.willDisplay = { itemIdentifier, cell in\n\n}\n```\n\n`TableViewDiffableDataSource` provides handlers for reordering cells like the `UICollectionViewDiffableDataSource` reordering handlers that Apple provides:\n\n```swift\n// Allow every item to be reordered\ntableViewDataSource.reorderingHandlers.canReorder = { item in return true }\n\n// Update the backing store from the did reorder transaction.\ntableViewDataSource.reorderingHandlers.didReorder = { [weak self] transaction, _ in\n    guard let self = self else { return }\n             \n    if let updatedCurrentItems = self.currentItems.applying(transaction.difference) {\n        self.currentItems = updatedCurrentItems\n    }\n}\n```\n\n### Empty datasource view\n\n`emptyView` displays the provided view when the datasource doesn't contain any items:\n\n```swift\ndiffableDataSource.emptyView = myEmptyView\n```\n\nAlternatively you can use `emptyContentConfiguration` and provide an `UIContentConfiguration`:\n\n```swift\nlet loadingConfiguration = UIContentUnavailableConfiguration.loading()\ndiffableDataSource.emptyContentConfiguration = loadingConfiguration\n```\n\n## UITableView Cell Registration\n\nA registration for the table view’s cells similar to `UICollectionView.CellRegistration`.\n\nUse a cell registration to register table cell views with your table view and configure each cell for display.\n\nThe following example creates a cell registration for cells of type `UITableViewCell` and string items. Each cells textfield displays its item string.\n\n```swift\nlet cellRegistration = UITableView.CellRegistration\u003cUITableViewCell, String\u003e { cell, indexPath, string in\n    var contentConfiguration = cell.defaultContentConfiguration()\n\n    contentConfiguration.text = string\n    contentConfiguration.textProperties.color = .lightGray\n\n    cell.contentConfiguration = contentConfiguration\n}\n```\n\nAfter you create a cell registration, you pass it in to ``dequeueConfiguredReusableCell(using:for:item:)``, which you call from your data source’s cell provider.\n\n```swift\ndataSource = UITableViewDiffableDataSource\u003cSection, String\u003e(tableView: tableView) {\n    tableView, indexPath, item in\n    return tableView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: item)\n}\n```\n\nAlternatively you can use the ``UICollectionViewDiffableDataSource`` and ``UITableViewDiffableDataSource`` initializers:\n\n```swift\nlet dataSource = UITableViewDiffableDataSource(tableView: myTableView, cellRegistration: cellRegistration)\n}\n```\n\n## UITableView Section View Registration\n\nA registration for the table view’s header/footer section views.\n\nThe following example creates a section view registration for views of type `UITableViewHeaderFooterView` for sections with strings. Each section header views default content configuration text displays its section string.\n\n```swift\nlet sectionViewRegistration = UITableView.SectionViewRegistration\u003cUITableViewHeaderFooterView, String\u003e {\n    sectionView, indexPath, string in\n     \n    var configuration = sectionView.defaultContentConfiguration()\n    configuration.text = string\n    sectionView.contentConfiguration = configuration\n}\n```\n     \nAfter you create a section view registration, you pass it in to ``dequeueConfiguredReusableSectionView(using:section:)``, which you call from your data source’s section header view provider.\n\n```swift\ndataSource.headerViewProvider = { tableView, section in\n    return tableView.dequeueConfiguredReusableSectionView(using: sectionViewRegistration, section: section)\n}\n```\n\nAlternatively you can also ``applyHeaderViewRegistration()`` and `applyFooterViewRegistration()``:\n\n```swift\ndataSource.applyHeaderViewRegistration(sectionViewRegistration)\n```\n\n## Diffable DataSource Snapshot Apply Options\n\nOptions for applying snapshots to a diffable datasource:\n\n```swift\n// Applies the snapshot animated with default animation duration.\ndataSource.apply(mySnapshot, .animated)\n\n// Applies the snapshot animated with the specified animation duration.\ndataSource.apply(mySnapshot, .animated(duration: 2.0))\n\n// Applies the snapshot non animated.\ndataSource.apply(mySnapshot, .withoutAnimation)\n\n// Applies the snapshot using reload data.\ndataSource.apply(mySnapshot, .usingReloadData)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflocked%2Fadvancedcollectiontableview-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflocked%2Fadvancedcollectiontableview-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflocked%2Fadvancedcollectiontableview-ios/lists"}