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

时间:2017-09-07 12:42:44

标签: ios objective-c swift3 cocoapods appdelegate

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

问题是,在将AppDelegate导入Bridge文件后,AppDelegate.h文件中导入的框架出错。 "找不到文件" 如果我从桥文件中删除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

1 个答案:

答案 0 :(得分:1)

@class DCPathButton;移至您的AppDelegate.m并将其添加到.h:Contractor startdate Area BARNES Bill 2016-10-28 Area a BARNES Bill 2016-11-02 Area a BARNES Bill 2016-11-07 Area b BARNES Bill 2016-11-01 Area a BARNES Bill 2017-01-09 Area a BARNES Bill 2017-02-17 Area b BAUME Peter BAUME Peter BILLINGS Roger CAMPBELL Lee 2017-07-03 Area b CAMPBELL Lee 2017-07-26 Area b CAMPBELL Lee 2017-07-12 Area b CAMPBELL Lee 2017-07-14 Area b CARNE Jim 2017-07-05 Area a CENTRONE Krista COMBES Greg 2017-07-05 Area b COMBES Greg 2017-07-05 Area b COMBES Greg 2016-09-09 Area c DEVRIES Phil 2017-07-19 Area c DEVRIES Phil 2018-03-26 Area A