我可以将PanGestureRecognizer添加到SKSpriteNode吗?

时间:2018-03-25 18:39:56

标签: swift4 uipangesturerecognizer

这是我的代码

---
layout: work
date: 2018-03-25 01:00:00 +0900
category: illustration
title: A test work product image
subtitle: This is a great product
---

Here is a test of a product which uses **markdown**.

我收到此错误

  

类型的价值' SKSpriteNode'没有会员' addGestureRecognizer'

这个

的解决方案是什么?

1 个答案:

答案 0 :(得分:0)

Try this please:

node.inputView?.addGestureRecognizer(myPanGestureRecognizer)