xcode – Swift 2.2:不再导入GCC_PREPROCESSOR_DEFINITIONS常量
发布时间:2020-12-14 17:55:39 所属栏目:百科 来源:网络整理
导读:technique to separate API keys in a xcconfig file described in this answer不适用于Swift 2.2 due to a bug (SR-909). 有没有解决方法? 解决方法 感谢您指出该错误,不会在一段时间内想出这个.如果有任何帮助,我最后添加了一个额外的objc常量桥接到Swift
technique to separate API keys in a xcconfig file described in this answer不适用于Swift 2.2
due to a bug (SR-909).
有没有解决方法? 解决方法
感谢您指出该错误,不会在一段时间内想出这个.如果有任何帮助,我最后添加了一个额外的objc常量桥接到Swift并使用swift中的桥接常量:
// Constants.h extern NSString *const kDropBoxAPIKey; // Constants.m NSString *const kDropBoxAPIKey = DROPBOX_API_KEY; // xxx-Bridging-Header.h #import "Constants.h" 然后在Swift中使用桥接键 // xx.swift ... // let auth = DropboxAuth(appKey: DROPBOX_API_KEY) let auth = DropboxAuth(appKey: kDropBoxAPIKey) ... (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |