【问题标题】:How to use method for pan gestures in swift 3?如何在swift 3中使用平移手势的方法?
【发布时间】:2018-01-22 06:04:44
【问题描述】:

这行给了我错误:

让识别器 = UIPanGestureRecognizer(target: self, action: Selector(("handlePan")))

【问题讨论】:

  • 让识别器= UIPanGestureRecognizer.init(目标:自我,动作:#selector(handlePan))。使用这条线。
  • 我试过了,但还是不行。
  • 请分享代码
  • 如果您也提供错误信息就好了。

标签: ios


【解决方案1】:

据我了解您的问题将通过稍微更改语法来解决。我也遇到过这种情况。试试这个

let recognizer = UIPanGestureRecognizer(target: self, action: #selector(CustomTableViewCell.handlePanTest(_:)))

【讨论】:

  • 感谢您的帮助@AXY
猜你喜欢
  • 1970-01-01
  • 2017-05-04
  • 1970-01-01
  • 2018-10-09
  • 1970-01-01
  • 2016-09-27
  • 1970-01-01
  • 1970-01-01
  • 2011-06-28
相关资源
最近更新 更多