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
18d0b1f6
Commit
18d0b1f6
authored
4 years ago
by
Toby Brennan
Browse files
Options
Download
Email Patches
Plain Diff
Minor fix to scrollPositionSetter
parent
de016a2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/ASCollectionView/Implementation/ASTableView.swift
+2
-3
Sources/ASCollectionView/Implementation/ASTableView.swift
Sources/ASCollectionView/UIKitExtensions/UIScrollView+Convenience.swift
+1
-1
...ectionView/UIKitExtensions/UIScrollView+Convenience.swift
with
3 additions
and
4 deletions
+3
-4
Sources/ASCollectionView/Implementation/ASTableView.swift
+
2
-
3
View file @
18d0b1f6
...
...
@@ -320,9 +320,8 @@ public struct ASTableView<SectionID: Hashable>: UIViewControllerRepresentable, C
let
contentInsets
=
tableViewController
?
.
tableView
.
contentInset
??
.
zero
tableViewController
?
.
tableView
.
setContentOffset
(
CGPoint
(
x
:
0
,
y
:
contentInsets
.
top
),
animated
:
animated
)
case
.
bottom
:
let
contentSize
=
tableViewController
?
.
tableView
.
contentSizePlusInsets
??
.
zero
let
visibleHeight
=
tableViewController
?
.
tableView
.
frame
.
height
??
.
zero
tableViewController
?
.
tableView
.
setContentOffset
(
CGPoint
(
x
:
0
,
y
:
contentSize
.
height
-
visibleHeight
),
animated
:
animated
)
let
maxOffset
=
tableViewController
?
.
tableView
.
maxContentOffset
??
.
zero
tableViewController
?
.
tableView
.
setContentOffset
(
maxOffset
,
animated
:
animated
)
}
DispatchQueue
.
main
.
async
{
self
.
parent
.
scrollPositionSetter
?
.
wrappedValue
=
nil
...
...
This diff is collapsed.
Click to expand it.
Sources/ASCollectionView/UIKitExtensions/UIScrollView+Convenience.swift
+
1
-
1
View file @
18d0b1f6
...
...
@@ -15,6 +15,6 @@ extension UIScrollView
{
CGPoint
(
x
:
max
(
0
,
contentSizePlusInsets
.
width
-
bounds
.
width
),
y
:
max
(
0
,
contentSizePlusInsets
.
height
+
safeAreaInsets
.
top
-
bounds
.
height
))
y
:
max
(
0
,
contentSizePlusInsets
.
height
-
safeAreaInsets
.
top
-
bounds
.
height
))
}
}
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