You can\'t write to self.state in the subclass unless you import UIGestureRecognizerSubclass.h as indicated here.
self.state
UIGestureRecognizerSubclass.h
In a Swift environment, I
The Swift equivalent is simply:
import UIKit.UIGestureRecognizerSubclass
That imports the appropriate header.