Skip to content

Commit f018533

Browse files
authored
Merge pull request #14 from abema/fix-display-for-only-one-page
Fix display logic for only one page view
2 parents 807b813 + db5a6a0 commit f018533

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/ContentScrollView.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ open class ContentScrollView: UIScrollView {
3030
return min(lastIndex, i)
3131
}()
3232

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

0 commit comments

Comments
 (0)