diff --git a/doric-iOS/Pod/Classes/Refresh/DoricSwipeRefreshLayout.m b/doric-iOS/Pod/Classes/Refresh/DoricSwipeRefreshLayout.m index e3170a9b..74b3d8b6 100644 --- a/doric-iOS/Pod/Classes/Refresh/DoricSwipeRefreshLayout.m +++ b/doric-iOS/Pod/Classes/Refresh/DoricSwipeRefreshLayout.m @@ -96,7 +96,17 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL - (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (scrollView.contentOffset.y <= 0) { - [self.swipePullingDelegate setPullingDistance:-scrollView.contentOffset.y]; + if ([self.contentView isKindOfClass:UIScrollView.class] + && ((UIScrollView *) self.contentView).contentOffset.y > 0) { + scrollView.contentOffset = (CGPoint) {0, 0}; + } else { + [self.swipePullingDelegate setPullingDistance:-scrollView.contentOffset.y]; + } + } else if (scrollView.contentOffset.y + scrollView.height > scrollView.contentSize.height) { + if ([self.contentView isKindOfClass:UIScrollView.class] + && ((UIScrollView *) self.contentView).contentOffset.y + self.contentView.height < ((UIScrollView *) self.contentView).contentSize.height) { + scrollView.contentOffset = (CGPoint) {0, scrollView.contentSize.height - scrollView.height}; + } } }