Commit 029a0f89 authored by Apptek Studios's avatar Apptek Studios
Browse files

Add support for RandomAccessCollection to single-section convenience init method

parent ddce07ca
Showing with 5 additions and 4 deletions
+5 -4
......@@ -27,11 +27,12 @@ extension ASCollectionView where SectionID == Int
/**
Initializes a collection view with a single section.
*/
public init<Data, DataID: Hashable, Content: View>(
data: [Data],
dataID dataIDKeyPath: KeyPath<Data, DataID>,
public init<DataCollection: RandomAccessCollection, DataID: Hashable, Content: View>(
data: DataCollection,
dataID dataIDKeyPath: KeyPath<DataCollection.Element, DataID>,
selectedItems: Binding<IndexSet>? = nil,
@ViewBuilder contentBuilder: @escaping ((Data, CellContext) -> Content))
@ViewBuilder contentBuilder: @escaping ((DataCollection.Element, CellContext) -> Content))
where DataCollection.Index == Int
{
let section = ASCollectionViewSection(
id: 0,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment