ios - Subclassing UIGestureRecognizer with Swift and Xcode 6 - how do I import UIGestureRecognizerSubclass.h? -
you can't write self.state in subclass unless import uigesturerecognizersubclass.h as indicated here.
in swift environment, i'm confused how i'd go importing this. tried import uigesturerecognizersubclass.h, , without .h, still can't write self.state.
how accomplish this?
you need have or create -bridging-header.h file import objc headers such 1 want. import line looks this:
#import <uikit/uigesturerecognizersubclass.h> if don't have bridge header file in app, easiest way 1 add together objc class project, , xcode inquire if want one, creates file , ties settings you. can delete objc class.
everything in header file automatically made available swift code, no need add together import lines in swift files.
ios uigesturerecognizer swift ios8 xcode6
No comments:
Post a Comment