Method cannot be marked @objc because the type of the parameter 1 cannot be represented in Objective

错误:Method cannot be marked @objc because the type of the parameter 1 cannot be represented in Objective-C

场景:swift中有需要OC调用的方法,前面加@objc ,编译器报错

翻译:方法中有一个参数没有变成OC

解决方案,确保每个参数(主要包括,类和枚举)都已经桥接 Objective-C

注意,枚举在文件内,在类外面,所以要在枚举前加@objc



 

@objc enum GHNFollowBtnModule: Int {
    case column = 0
    case topic = 1
    case author = 2
    case none = 999
}

 

你可能感兴趣的:(Method cannot be marked @objc because the type of the parameter 1 cannot be represented in Objective)