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
c5d4e470
Commit
c5d4e470
authored
5 years ago
by
Apptek Studios
Browse files
Options
Download
Email Patches
Plain Diff
Refine API
parent
e230a9bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Demo/ASCollectionViewDemo/Screens/TableViewDragAndDrop/TableViewDragAndDropScreen.swift
+4
-4
...ens/TableViewDragAndDrop/TableViewDragAndDropScreen.swift
Sources/ASCollectionView/ASDragDropConfig.swift
+1
-1
Sources/ASCollectionView/ASDragDropConfig.swift
with
5 additions
and
5 deletions
+5
-5
Demo/ASCollectionViewDemo/Screens/TableViewDragAndDrop/TableViewDragAndDropScreen.swift
+
4
-
4
View file @
c5d4e470
...
...
@@ -21,7 +21,7 @@ struct TableViewDragAndDropScreen: View
id
:
0
,
data
:
groupA
,
dataID
:
\
.
self
,
dragDropConfig
:
ASDragDropConfig
(
dataBinding
:
$
groupA
)
.
enableReordering
(
shouldMoveItem
:
nil
),
dragDropConfig
:
ASDragDropConfig
(
dataBinding
:
$
groupA
)
.
enableReordering
(),
onSwipeToDelete
:
{
index
,
_
,
callback
in
self
.
groupA
.
remove
(
at
:
index
)
callback
(
true
)
...
...
@@ -38,7 +38,7 @@ struct TableViewDragAndDropScreen: View
id
:
1
,
data
:
groupB
,
dataID
:
\
.
self
,
dragDropConfig
:
ASDragDropConfig
(
dataBinding
:
$
groupB
)
.
enableReordering
(
shouldMoveItem
:
nil
),
dragDropConfig
:
ASDragDropConfig
(
dataBinding
:
$
groupB
)
.
enableReordering
(),
onSwipeToDelete
:
{
index
,
_
,
callback
in
self
.
groupB
.
remove
(
at
:
index
)
callback
(
true
)
...
...
@@ -57,7 +57,7 @@ struct TableViewDragAndDropScreen: View
id
:
0
,
data
:
groupC
,
dataID
:
\
.
self
,
dragDropConfig
:
ASDragDropConfig
(
dataBinding
:
$
groupC
)
.
enableReordering
(
shouldMoveItem
:
nil
),
dragDropConfig
:
ASDragDropConfig
(
dataBinding
:
$
groupC
)
.
enableReordering
(),
onSwipeToDelete
:
{
index
,
_
,
callback
in
self
.
groupC
.
remove
(
at
:
index
)
callback
(
true
)
...
...
@@ -73,7 +73,7 @@ struct TableViewDragAndDropScreen: View
id
:
1
,
data
:
groupD
,
dataID
:
\
.
self
,
dragDropConfig
:
ASDragDropConfig
(
dataBinding
:
$
groupD
)
.
enableReordering
(
shouldMoveItem
:
nil
),
dragDropConfig
:
ASDragDropConfig
(
dataBinding
:
$
groupD
)
.
enableReordering
(),
onSwipeToDelete
:
{
index
,
_
,
callback
in
self
.
groupD
.
remove
(
at
:
index
)
callback
(
true
)
...
...
This diff is collapsed.
Click to expand it.
Sources/ASCollectionView/ASDragDropConfig.swift
+
1
-
1
View file @
c5d4e470
...
...
@@ -37,7 +37,7 @@ public extension ASDragDropConfig
self
.
dataBinding
=
dataBinding
}
func
enableReordering
(
shouldMoveItem
:
((
_
sourceIndexPath
:
IndexPath
,
_
destinationIndexPath
:
IndexPath
)
->
Bool
)?)
->
Self
func
enableReordering
(
shouldMoveItem
:
((
_
sourceIndexPath
:
IndexPath
,
_
destinationIndexPath
:
IndexPath
)
->
Bool
)?
=
nil
)
->
Self
{
var
this
=
self
this
.
dragEnabled
=
true
...
...
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