Closed toyinswift closed 4 years ago
Thanks for trying out this library :) I've added an example to the readme that demonstrates a collectionView with a single section. I also went and edited the stackoverflow answer as that was for an earlier version of this library.
Here's an example with the current version:
import ASCollectionView
import SwiftUI
struct SingleSectionExampleView: View {
@State var dataExample = (0 ..< 30).map { $0 }
var body: some View
{
ASCollectionView(data: dataExample, dataID: \.self) { item, _ in
Color.blue
.overlay(Text("\(item)"))
}
.layout {
.grid(layoutMode: .adaptive(withMinItemSize: 100),
itemSpacing: 5,
lineSpacing: 5,
itemSize: .absolute(50))
}
}
}
To make sure you're using the latest version you'll likely need to go to File → Swift packages → Update to latest package versions 👍
Please update the readme with very basic usage example. Am an android developer learning SwiftUi, so all these can be a little daunting!
Here is what i tried but am getting errors:
found that Grid example on stackoverflow. But am am getting this error message in Xcode "Use of unresolved identifier 'ASCollectionViewLayoutGrid'"