Awesome Open Source
Awesome Open Source

CollectionUI

GitHub tag (latest by date) GitHub

CollectionUI is a simple SwiftUI wrapper for (simple) UICollectionViews.

Installation

Swift Package Manager (Xcode 11 and above)

  1. Select File/Swift Packages/Add Package Dependency… from the menu.
  2. Paste https://github.com/sbertix/CollectionUI.git.
  3. Follow the steps.

Usage

import SwiftUI
import CollectionUI

/// A `View`.
struct ContentView : View {
    @State var content = ["A", "B", "C"]

    var body: some View {
        CollectionView(content, id: \.hashValue) { Text($0) }
            .axis(.horizontal)
            .indicators(false)
            .groupSize(.init(widthDimension: .fractionalWidth(0.5),
                             heightDimension: .fractionalHeight(1)))
            .itemSize(.init(widthDimension: .fractionalWidth(1),
                            heightDimension: .fractionalHeight(1)))
            .frame(minHeight: 80)
            .padding()
    }
}

License

CollectionUI is licensed under the MIT license.
Check out LICENSE for more info.



Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Swift (65,849
Swiftui (2,258
Uicollectionview (270