如何创建 AppDelegate 到第三方框架桥接文件

How to create AppDelegate to Third party Framework bridge file

我有一个用 Objective C 编写的项目,新功能是用 Swift 3.1 编写的 我的要求是访问 AppDelegate.h 文件中声明的变量。所以我在我的桥接文件中导入 AppDelegate。现在我可以在 Swift class 文件中声明 Appdelegate 对象,还可以访问在 Appdelegate 中声明的变量。

问题是,将AppDelegate导入Bridge文件后,AppDelegate.h文件中导入的框架出现错误。 "File not found" 如果我从桥接文件中删除 AppDelegate.h 它工作正常。

感谢您的帮助

#import <UIKit/UIKit.h>
#import "DCPathButton.h"    <- ERROR IN THIS FRAMEWORK
#import <CoreLocation/CoreLocation.h>



@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property NSInteger addUserFlag;
@property NSInteger addDeviceFlag;
@property NSInteger userProfileFlag;
@property NSInteger backToAddHomeFlag;
@property (strong, nonatomic) NSArray *loginResponseArray;
@property NSInteger AcFlag;
@property (strong,nonatomic) NSDictionary *FCM_Dict;
@property (strong,nonatomic) NSString *supportPhone;
@property (strong,nonatomic) NSString *FCM_Key;
@property DCPathButton *dcPathButtonInAppDelgt;
@property  (strong,nonatomic) NSString *disableAddHomeBtn;
@property  (strong,nonatomic) NSString *disableAddRoomBtn;
@property  (strong,nonatomic) NSString *disableAddDeviceBtn;
@property  (strong,nonatomic) NSString *disableAddUserBtn;
@property (strong,nonatomic) NSString *sideMenuFlag;
@property (nonatomic, strong) CLLocationManager *locationManager;
@property NSInteger homeOrAwayFlag;
@end

#import "DCPathButton.h" 移动到您的 AppDelegate.m 并将其添加到 .h 中:@class DCPathButton;