1
有沒有辦法查看swift中可用的Objective-C界面?在Swift中獲取Objective-C接口?
例如,如果我聲明此目的-C接口:
#import <UIKit/UIKit.h>
#define STRING_CONSTANT @"a_string_constant"
#define BOOL_CONSTANT YES
@interface ViewController : UIViewController
@end
我可以在夫特但不BOOL_CONSTANT訪問STRING_CONSTANT。
「導航 - >跳轉到生成的接口」 –
謝謝你,我已經加入這個下面 – anuj
這裏的答案是,討論的文章*爲什麼*,並且顯示了一種使你的Swift代碼可用的'#define'例如BOOL常量的方法:https://medium.com/@YogevSitton/from-objective-c-to-swift-use-complex-define -macros-in-swift-28cdff464fc7 – DonMag