diff --git a/VDS/Components/Pagination/Pagination.swift b/VDS/Components/Pagination/Pagination.swift index cf4f9183..50684e7e 100644 --- a/VDS/Components/Pagination/Pagination.swift +++ b/VDS/Components/Pagination/Pagination.swift @@ -13,7 +13,7 @@ import Combine ///Pagination is a control that enables customers to navigate multiple pages of content by selecting either a specific page or the next or previous set of four pages. @objcMembers @objc(VDSPagination) -open class Pagination: View { +open class Pagination: Control, Changeable { //-------------------------------------------------- // MARK: - Private Properties @@ -52,6 +52,8 @@ open class Pagination: View { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- + public var onChangeSubscriber: AnyCancellable? + ///Previous button to select previous page public let previousButton: PaginationButton = .init(type: .previous) ///Next button to select next page @@ -195,6 +197,8 @@ open class Pagination: View { let isNextAction = sender == nextButton _selectedPageIndex = if isNextAction { _selectedPageIndex + 1 } else { _selectedPageIndex - 1 } updateSelection() + onPageDidSelect?(selectedPage) + sendActions(for: .valueChanged) DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in guard let self else { return } UIAccessibility.post(notification: .announcement, argument: paginationDescription) @@ -250,6 +254,7 @@ extension Pagination: UICollectionViewDelegate, UICollectionViewDataSource, UICo _selectedPageIndex = indexPath.row updateSelection() onPageDidSelect?(selectedPage) + sendActions(for: .valueChanged) } }