From d4a604bd54a968a5eafeb222e2d05e1dba712936 Mon Sep 17 00:00:00 2001 From: Sergey Nes Date: Sun, 20 Nov 2022 11:35:34 -0500 Subject: [PATCH] Reset Koloda and recover the state to show the card with some index --- Pod/Classes/KolodaView/KolodaView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pod/Classes/KolodaView/KolodaView.swift b/Pod/Classes/KolodaView/KolodaView.swift index ddd027e5..ea4c9a15 100644 --- a/Pod/Classes/KolodaView/KolodaView.swift +++ b/Pod/Classes/KolodaView/KolodaView.swift @@ -398,8 +398,8 @@ open class KolodaView: UIView, DraggableCardDelegate { } // MARK: Private - private func clear() { - currentCardIndex = 0 + private func clear(index: Int = 0) { + currentCardIndex = index for card in visibleCards { card.removeFromSuperview() @@ -646,8 +646,8 @@ open class KolodaView: UIView, DraggableCardDelegate { } } - public func resetCurrentCardIndex() { - clear() + public func resetCurrentCardIndex(index: Int = 0) { + clear(index: index) reloadData() }