Skip to content

Commit

Permalink
Add missing scrollViewWillEndDragging passthrough delegate (#796)
Browse files Browse the repository at this point in the history
* Add scrollViewWillEndDragging delegate

* Make sure delegate can respond to scrollViewWillEndDragging

* Add changes to CHANGELOG.md
  • Loading branch information
xezero authored and Adlai-Holler committed Feb 12, 2018
1 parent 479d404 commit f0f3f9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Optimized ASNetworkImageNode loading and resolved edge cases where the image provided to the delegate was not the image that was loaded. [Adlai Holler](https://github.com/Adlai-Holler) [#778](https://github.com/TextureGroup/Texture/pull/778/)
- Make `ASCellNode` tint color apply to table view cell accessories. [Vladyslav Chapaev](https://github.com/ShogunPhyched) [#764](https://github.com/TextureGroup/Texture/pull/764)
- Fix ASTextNode2 is accessing backgroundColor off main while sizing / layout is happening. [Michael Schneider](https://github.com/maicki) [#794](https://github.com/TextureGroup/Texture/pull/778/)
- Pass scrollViewWillEndDragging delegation through in ASIGListAdapterDataSource for IGListKit integration. [#796](https://github.com/TextureGroup/Texture/pull/796)

## 2.6
- [Xcode 9] Updated to require Xcode 9 (to fix warnings) [Garrett Moon](https://github.com/garrettmoon)
Expand Down
8 changes: 8 additions & 0 deletions Source/Private/ASIGListAdapterBasedDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
[self.delegate scrollViewWillBeginDragging:scrollView];
}

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
// IGListAdapter doesn't implement scrollViewWillEndDragging yet (pending pull request), so we need this check for now. Doesn't hurt to have it anyways :)
if ([self.delegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]) {
[self.delegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset];
}
}

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
[self.delegate scrollViewDidEndDragging:scrollView willDecelerate:decelerate];
Expand Down

0 comments on commit f0f3f9a

Please sign in to comment.