Skip to content

Instantly share code, notes, and snippets.

View mattadatta's full-sized avatar

Matthew Brown mattadatta

  • Ottawa, ON, Canada
View GitHub Profile
@mattadatta
mattadatta / CollectionView.swift
Last active August 11, 2025 04:38
CollectionView.swift - UIKit's UICollectionView implemented in SwiftUI using UIViewRepresentable
//
// SwiftUI `CollectionView` type implemented with UIKit's `UICollectionView` under the hood.
// Implemented using `UIViewRepresentable`, assigning a custom `UIHostingConfiguration` to
// the `contentConfiguration` property of custom `UICollectionViewCell`s.
//
// See below implementation for usage.
//
import SwiftUI
import UIKit