Skip to content

Commit

Permalink
Merge pull request #14 from abema/fix-display-for-only-one-page
Browse files Browse the repository at this point in the history
Fix display logic for only one page view
  • Loading branch information
kangnux committed Oct 10, 2023
2 parents 807b813 + db5a6a0 commit f018533
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/ContentScrollView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ open class ContentScrollView: UIScrollView {
return min(lastIndex, i)
}()

guard nextPageIndex > previousPageIndex else { return nil }
// MARK: 見えるページビューの判定
/// - ページが一つしかない場合、`nextPageIndex`と`previousPageIndex`は等しくて共に`0`と想定されます。
/// - 複数のページがある場合、`preloadingPageCount`が`0`の場合:`nextPageIndex`と`previousPageIndex`は等しいと想定されます。
/// - 複数のページがある場合、`preloadingPageCount`が`1`以上の場合:`nextPageIndex`は`previousPageIndex`より大きいと想定されます。
guard nextPageIndex >= previousPageIndex else { return nil }
return previousPageIndex...nextPageIndex
}

Expand Down

0 comments on commit f018533

Please sign in to comment.