GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - edonv/CollectionView: SwiftUI wrapper of UICollectionView.

BranchesTags
Open more actions menu

Latest commit

 

History

101 Commits
101 Commits

Folders and files

NameName
Last commit message
Last commit date
.swiftpm/xcode/package.xcworkspace/xcshareddata
.swiftpm/xcode/package.xcworkspace/xcshareddata
 
 
Sources
Sources
 
 
Tests/CollectionViewTests
Tests/CollectionViewTests
 
 
.gitignore
.gitignore
 
 
.spi.yml
.spi.yml
 
 
LICENSE
LICENSE
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 

Repository files navigation

CollectionView

CollectionView is a SwiftUI wrapper of UICollectionView.

Have you ever wanted to make an app solely in SwiftUI, but the processing tradeoff of using Grid, Lazy_Stack, and Lazy_Grid are too significant? Wish you could stick with SwiftUI but still get the processing power of UICollectionView? Then try out CollectionView!

It’s a SwiftUI wrapper for UICollectionView that exposes all UICollectionViewDelegate/UICollectionViewDataSourcePrefetching delegate functions (via view modifiers). Plus, on iOS 16+, you can utilize UIHostingConfiguration to use SwiftUI views for the cells.

Plus, by passing your data source as a Binding, it updates changes to the view using UICollectionViewDiffableDataSource. This also means it doesn't fully reload the view on every change, but rather, they're reloaded internally by the UICollectionView.

It’s still a work in progress (especially with testing everything + documentation), but please give it a try and send feedback my way!

Usage

  • Make sure to use .ignoresSafeArea() if it's meant to be full-screen.

To-Do's

  • Implement UICellConfigurationState.
  • Add support for NSCollectionView.
  • Make sure CollectionView isn't updating itself more than necessary? or is it not because it's a RepresentableView?
  • Condense initializers somehow...
  • Add support for section snapshots.
    • Add support for expandable sections.
  • Add support for section headers/footers.
  • Refactor cellRegistrationHandler out of primary initializers and replace with a UICollectionViewDiffableDataSource<Section, Item>.CellProvider closure to allow for more complicated configurations.
  • Finish documenting view modifiers.
  • Work on more concrete example for README/DocC articles.

About

SwiftUI wrapper of UICollectionView.

Topics

iosswiftswiftuiuicollectionviewuikituiviewrepresentable

Resources

Readme
MIT license
Activity

Stars

25 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.