Skip to content

Instantly share code, notes, and snippets.

@reejosamuel
Created December 6, 2016 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reejosamuel/48614954cd263a663f1e31d53595d616 to your computer and use it in GitHub Desktop.
Save reejosamuel/48614954cd263a663f1e31d53595d616 to your computer and use it in GitHub Desktop.
UITableView on a UIScrollView, passing gestures to swipe cell in UITableView
//
// CAPSScrollView.swift
// Pods
//
// Created by Reejo Samuel on 12/6/16.
//
//
import Foundation
import UIKit
class CAPSScrollView: UIScrollView, UIGestureRecognizerDelegate {
open func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
guard let wrapperView = NSClassFromString("UITableViewWrapperView"), let otherGestureView = otherGestureRecognizer.view else {
return false
}
if otherGestureView.isKind(of: wrapperView) && (otherGestureRecognizer is UIPanGestureRecognizer) {
return true
}
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment