Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
ASCollectionView
Commits
029a0f89
Commit
029a0f89
authored
5 years ago
by
Apptek Studios
Browse files
Options
Download
Email Patches
Plain Diff
Add support for RandomAccessCollection to single-section convenience init method
parent
ddce07ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ASCollectionView/ASCollectionView.swift
+5
-4
Sources/ASCollectionView/ASCollectionView.swift
with
5 additions
and
4 deletions
+5
-4
Sources/ASCollectionView/ASCollectionView.swift
+
5
-
4
View file @
029a0f89
...
...
@@ -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
<
Data
Collection
:
RandomAccessCollection
,
DataID
:
Hashable
,
Content
:
View
>
(
data
:
Data
Collection
,
dataID
dataIDKeyPath
:
KeyPath
<
Data
Collection
.
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
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets