southkin/ethicallistview
> "Always reuse your cells and release memory properly when displaying many items. That’s ethics." — Julius Caesar
✨ Features
- SwiftUI-style API, works out of the box
- Efficient under-the-hood rendering using UICollectionView / NSCollectionView
- Smooth performance with proper cell reuse and memory management
onLastItemAppearsupport for infinite scrolling- Cross-platform: iOS + macOS
📦 Installation (Swift Package Manager)
- Open Xcode > File > Add Packages...
- Enter repository URL:
``markdown https://github.com/southkin/EthicalListView ``
- In your Swift file:
``swift import EthicalListView ``
🚀 Usage Examples
Vertical List
EthicalListView.Vertical(items: yourItems) { item in
Text("\(item)")
.frame(width: 100, height: 100)
.background(Color.gray.opacity(0.2))
}Horizontal List
EthicalListView.Horizontal(items: yourItems) { item in
YourCustomView(item: item)
}
.frame(height: 200)Infinite Scroll
EthicalListView.Vertical(items: items) { item in
Text("\(item)")
.frame(width: 100, height: 100)
.background(Color.gray.opacity(0.2))
}
.onLastItemAppear {
loadMoreItems()
}💡 Behavior Notes
- If items are fixed-size with .frame, estimation reflects that.
- For dynamic content, layout adapts via intrinsic sizing.
- UIKit uses UICollectionView; AppKit uses NSCollectionView.
💻 Platform Support
- iOS 13+
- macOS 11+
Package Metadata
Repository: southkin/ethicallistview
Default branch: main
README: README.md