---
title: "重写UIView 滑动手势的问题"
author: "hua397"
date: "2012-11-29T18:25:11Z"
tags: []
categories: ["移动开发"]
slug: "uiview"
draft: false
lastmod: "2012-11-29T18:25:11Z"
id: 1738481
url: "https://hua397.iteye.com/blog/1738481"
---

今天做个功能:tableview中,在某个cell上左右滑动,显示/隐藏一个快捷菜单.

 

  开始用的swipe手势,发现不灵敏,经常触发不了,而且还会误点击table进入下一页.改成pan手势,效果不错,不过table就点不了了,就算重写view的touch那几个函数也是一样,搞得头都大了...

 

  后来找到这个 http://code4app.com/ios/Gesture-Based-TableView/4fc390ff6803fae626000000 (感谢这位哥们),发现可以用gestureShouldBegan这个delegate method来控制,哎,经验差别就在这了...