Skip to content

Commit

Permalink
Fix Daily table cell not sliding out
Browse files Browse the repository at this point in the history
Remove code which controls whether simultaneously recognize gestures.
If horizontal panning then `false`, which disabled cell to be able to
slide out.

**BIG MISTAKE**

It was introduced when I was preparing Swift-ZHI for open source Weibo.

BIG OOOOOPS......
  • Loading branch information
NicholasTD07 authored and NicholasTD07 committed Apr 3, 2016
1 parent 3379c84 commit db91f77
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions SwiftDaily-ZhiHu/Controllers/HideNavBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,3 @@ extension HideNavBarViewController: UIScrollViewDelegate {
return true
}
}

// MARK: GestureRecognizer Delegate
extension DailyTableViewController {
override func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {


if isPanningHorizontally(gestureRecognizer) {
return false
}


return super.gestureRecognizer(gestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer: otherGestureRecognizer)
}

private func isPanningHorizontally(gestureRecognizer: UIGestureRecognizer) -> Bool {
if let recognizer = gestureRecognizer as? UIPanGestureRecognizer {
let view = recognizer.view
if let superView = view?.superview {
let translation = recognizer.translationInView(superView)
if fabs(translation.x) > fabs(translation.y) {
return true
}
}
}

return false
}
}

0 comments on commit db91f77

Please sign in to comment.