Xcode中的swift项目,导入了Objc的代码,结果:
#import <Foundation/Foundation.h>
@class KKGestureLockView;
…
@interface KKGestureLockView : UIView
出错:
KKGestureLockView.h:24:32: Cannot find interface declaration for ‘UIView’, superclass of ‘KKGestureLockView’
如图:
折腾了半天,最后解决办法是:
加入导入头文件:
#import <UIKit/UIKit.h>
变成:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class KKGestureLockView;
…
@interface KKGestureLockView : UIView
即可。
转载请注明:在路上 » [已解决]ObjC代码出错:KKGestureLockView.h Cannot find interface declaration for UIView superclass of KKGestureLockView