Swiftpack.co - michzio/SwifUICollectionView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by michzio.
michzio/SwifUICollectionView 0.1.0
SwiftUI CollectionView wrapper
⭐️ 4
🕓 2 weeks ago
.package(url: "https://github.com/michzio/SwifUICollectionView.git", from: "0.1.0")


Read my tutorial to learn more about SwiftUI CollectionView


Usage - Cocoapods

pod 'SwifUICollectionView'

Usage - Swift Package Manager

Once you have your Swift package set up, adding SwifUICollectionView as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/michzio/SwifUICollectionView.git", .upToNextMajor(from: "0.0.9"))

How to use

                layout: createLayout(),
                sections: sections,
                items: [
                    .feature : Item.featureItems,
                    .categories : Item.categoryItems
                supplementaryKinds: [UICollectionView.elementKindSectionHeader, UICollectionView.elementKindSectionFooter],
                supplementaryContent: { kind, indexPath, section, item in
                    switch kind {
                    case UICollectionView.elementKindSectionHeader:
                        return AnyView(Text("Header").font(.system(size: indexPath.section == 0 ? 30 : 16)))
                    case UICollectionView.elementKindSectionFooter:
                        return AnyView(Text("Footer"))
                        return AnyView(EmptyView())
            content: { indexPath, item in
                let section = sections[indexPath.section]
                    ZStack {
                        section == .feature ? Color.green : Color.red

                        Text("\(section.rawValue) (\(indexPath.section), \(indexPath.row))")


Stars: 4
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Fix Package.swift location
3 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics