Skip to content

Commit

Permalink
Fix card insertion after removing first card (closes #179)
Browse files Browse the repository at this point in the history
  • Loading branch information
serejahh committed Aug 22, 2016
1 parent 9261a2f commit 9ff579f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Pod/Classes/KolodaView/KolodaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,11 @@ public class KolodaView: UIView, DraggableCardDelegate {

visibleCards.append(nextCardView)
configureCard(nextCardView, atIndex: UInt(currentCardIndex + index))
insertSubview(nextCardView, belowSubview: visibleCards[index - 1])
if index > 0 {
insertSubview(nextCardView, belowSubview: visibleCards[index - 1])
} else {
insertSubview(nextCardView, atIndex: 0)
}
}
}
}
Expand Down

0 comments on commit 9ff579f

Please sign in to comment.