Created
December 6, 2016 08:08
-
-
Save reejosamuel/48614954cd263a663f1e31d53595d616 to your computer and use it in GitHub Desktop.
UITableView on a UIScrollView, passing gestures to swipe cell in UITableView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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