Skip to content
GitLab
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
cde0b1e8
Unverified
Commit
cde0b1e8
authored
4 years ago
by
Anthony Drendel
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add background color modifier to ASCollectionView (#1)
parent
4550cd5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/ASCollectionView/ASCollectionView+Modifiers.swift
+8
-0
Sources/ASCollectionView/ASCollectionView+Modifiers.swift
Sources/ASCollectionView/Implementation/ASCollectionView.swift
+3
-0
...es/ASCollectionView/Implementation/ASCollectionView.swift
with
11 additions
and
0 deletions
+11
-0
Sources/ASCollectionView/ASCollectionView+Modifiers.swift
+
8
-
0
View file @
cde0b1e8
...
...
@@ -67,6 +67,14 @@ public extension ASCollectionView
return
this
}
/// Sets the collection view's background color
func
backgroundColor
(
_
color
:
UIColor
?)
->
Self
{
var
this
=
self
this
.
backgroundColor
=
color
return
this
}
/// Set whether to show scroll indicators
func
scrollIndicatorsEnabled
(
horizontal
:
Bool
=
true
,
vertical
:
Bool
=
true
)
->
Self
{
...
...
This diff is collapsed.
Click to expand it.
Sources/ASCollectionView/Implementation/ASCollectionView.swift
+
3
-
0
View file @
cde0b1e8
...
...
@@ -28,6 +28,8 @@ public struct ASCollectionView<SectionID: Hashable>: UIViewControllerRepresentab
internal
var
onScrollCallback
:
OnScrollCallback
?
internal
var
onReachedBoundaryCallback
:
OnReachedBoundaryCallback
?
internal
var
backgroundColor
:
UIColor
?
internal
var
horizontalScrollIndicatorEnabled
:
Bool
=
true
internal
var
verticalScrollIndicatorEnabled
:
Bool
=
true
internal
var
contentInsets
:
UIEdgeInsets
=
.
zero
...
...
@@ -184,6 +186,7 @@ public struct ASCollectionView<SectionID: Hashable>: UIViewControllerRepresentab
func
updateCollectionViewSettings
(
_
collectionView
:
UICollectionView
)
{
assignIfChanged
(
collectionView
,
\
.
backgroundColor
,
newValue
:
parent
.
backgroundColor
)
assignIfChanged
(
collectionView
,
\
.
dragInteractionEnabled
,
newValue
:
true
)
assignIfChanged
(
collectionView
,
\
.
alwaysBounceVertical
,
newValue
:
parent
.
alwaysBounceVertical
)
assignIfChanged
(
collectionView
,
\
.
alwaysBounceHorizontal
,
newValue
:
parent
.
alwaysBounceHorizontal
)
...
...
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