Skip to content

Commit

Permalink
Fix issues and update example
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Vodolazkyi authored and Anton Vodolazkyi committed Apr 17, 2017
1 parent 52cf039 commit 9d313f6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Example/Koloda/BackgroundAnimationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ extension BackgroundAnimationViewController: KolodaViewDelegate {
// MARK: KolodaViewDataSource
extension BackgroundAnimationViewController: KolodaViewDataSource {

func kolodaSpeedThatCardShouldDrag(_ koloda: KolodaView) -> DragSpeed {
return .default
}

func kolodaNumberOfCards(_ koloda: KolodaView) -> Int {
return numberOfCards
}
Expand Down
4 changes: 4 additions & 0 deletions Example/Koloda/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ extension ViewController: KolodaViewDataSource {
return dataSource.count
}

func kolodaSpeedThatCardShouldDrag(_ koloda: KolodaView) -> DragSpeed {
return .default
}

func koloda(_ koloda: KolodaView, viewForCardAt index: Int) -> UIView {
return UIImageView(image: dataSource[Int(index)])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private let cardResetAnimationSpringBounciness: CGFloat = 10.0
private let cardResetAnimationSpringSpeed: CGFloat = 20.0
private let cardResetAnimationKey = "resetPositionAnimation"
private let cardResetAnimationDuration: TimeInterval = 0.2
internal var cardSwipeActionAnimationDuration: TimeInterval = DragSpeed.default.rawValue

public class DraggableCardView: UIView, UIGestureRecognizerDelegate {

Expand All @@ -55,7 +56,6 @@ public class DraggableCardView: UIView, UIGestureRecognizerDelegate {
private var dragBegin = false
private var dragDistance = CGPoint.zero
private var swipePercentageMargin: CGFloat = 0.0
private var cardSwipeActionAnimationDuration: TimeInterval = DragSpeed.default.rawValue


//MARK: Lifecycle
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/KolodaView/KolodaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ open class KolodaView: UIView, DraggableCardDelegate {
return super.point(inside: point, with: event)
}

if super.pointInside(point, withEvent: event) {
if super.point(inside: point, with: event) {
return visibleCards.count > 0
}
else {
Expand Down

0 comments on commit 9d313f6

Please sign in to comment.