我無法使用手勢識別器設置'enabled'屬性。我嘗試通過編程方式創建識別器,並在Xcode
中添加@IBAction
,並通過控制拖動代碼將其連接。如何在Swift中爲手勢識別器設置'enabled'屬性
我嘗試使用性質是這樣的:
swipeUpOccurred(swipeUp: UISwipeGestureRecognizer).enabled = false
但它顯示錯誤:
Value of type '(UISwipeGestureRecognizer) ->' does not have member 'enabled'
它原來是這麼簡單...謝謝! –
@AntonPlatonov歡迎伴侶:) –