在目标C中声明快速协议委托变量时出错

时间:2018-10-23 16:12:01

标签: objective-c swift protocols

错误:找不到“ GameDelegate”的协议声明;

//Swift protocol
import AVFoundation
import UIKit;

@objc protocol GameDelegate {
    func lostConnection()
}

目标C类:

//play.h file
#import "SimpliSafe-Swift.h"

@interface SSStreamManager : NSObject 

@property (assign) id<GameDelegate> delegate

@end

1 个答案:

答案 0 :(得分:1)

请勿将Swift生成的标头导入标头文件!替换

#import "SimpliSafe-Swift.h"

使用

@protocol GameDelegate;