diff --git a/Source/UI/CandidateUI/HorizontalCandidateController.swift b/Source/UI/CandidateUI/HorizontalCandidateController.swift index 8419a16b..a6494bb7 100644 --- a/Source/UI/CandidateUI/HorizontalCandidateController.swift +++ b/Source/UI/CandidateUI/HorizontalCandidateController.swift @@ -260,10 +260,11 @@ public class HorizontalCandidateController: CandidateController { } if currentPage + 1 >= pageCount { - currentPage = 1 + currentPage = 0 + } else { + currentPage += 1 } - currentPage += 1 candidateView.highlightedIndex = 0 layoutCandidateView() return true @@ -275,10 +276,11 @@ public class HorizontalCandidateController: CandidateController { } if currentPage == 0 { - currentPage = pageCount + currentPage = pageCount - 1 + } else { + currentPage -= 1 } - currentPage -= 1 candidateView.highlightedIndex = 0 layoutCandidateView() return true diff --git a/Source/UI/CandidateUI/VerticalCandidateController.swift b/Source/UI/CandidateUI/VerticalCandidateController.swift index e2432248..05a9b4dd 100644 --- a/Source/UI/CandidateUI/VerticalCandidateController.swift +++ b/Source/UI/CandidateUI/VerticalCandidateController.swift @@ -266,10 +266,11 @@ public class VerticalCandidateController: CandidateController { } if currentPage + 1 >= pageCount { - currentPage = 1 + currentPage = 0 + } else { + currentPage += 1 } - currentPage += 1 candidateView.highlightedIndex = 0 layoutCandidateView() return true @@ -281,10 +282,11 @@ public class VerticalCandidateController: CandidateController { } if currentPage == 0 { - currentPage = pageCount + currentPage = pageCount - 1 + } else { + currentPage -= 1 } - currentPage -= 1 candidateView.highlightedIndex = 0 layoutCandidateView() return true