无法在Swift项目中构建Objective C框架

时间:2017-08-02 06:26:04

标签: ios swift objective-c-framework

我创建了一个Objective C框架,我想在Swift Project中使用它。我想在框架中只公开一个头文件。以下是我的头文件

//
//  VideoPlayer.h
//  DRMFrameworkObjc
//
//  Created by Next on 01/08/17.
//  Copyright © 2017 Next. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Streaming.h"
#import "LicenseManager.h"
#import <widevine_cdm_sdk_insecure_dev_sim/DashToHlsApiAVFramework.h>
#import <AVKit/AVKit.h>
#import <AVFoundation/AVFoundation.h>

@interface VideoPlayer : NSObject<StreamingDelegate>

@property(nonatomic) Streaming* streaming;
@property(nonatomic) AVPlayer* player;
@property(nonatomic) AVURLAsset* asset;
@property(nonatomic) NSArray* assetKeysRequiredToPlay;
@property(nonatomic) AVPlayerItem* playerItem;

-(void)initWithURl:(NSURL*)url playerInstance:(AVPlayer*)player controllerInstance:(UIViewController*) controller;
-(void)setupStreaming:(NSURL*)url controllerInstance:(UIViewController*) controller;
-(void)streamingReady:(NSNotification*)notification;

@end

所以我在Umbrella标题中添加了这个标题,如下所示:

//
//  DRMFrameworkObjc.h
//  DRMFrameworkObjc
//
//  Created by Next on 01/08/17.
//  Copyright © 2017 Next. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for DRMFrameworkObjc.
FOUNDATION_EXPORT double DRMFrameworkObjcVersionNumber;

//! Project version string for DRMFrameworkObjc.
FOUNDATION_EXPORT const unsigned char DRMFrameworkObjcVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <DRMFrameworkObjc/PublicHeader.h>


#import <DRMFrameworkObjc/VideoPlayer.h>

当我将这个框架添加到Swift项目中时,我得到了#34;无法构建Objective C框架......&#34;和其他错误是#34;找不到Streaming.h文件。&#34;。我在桥接头中添加了VideoPlayer.h文件。当我不希望它暴露时,为什么我没有找到Streaming.h?我创建Objective C框架的方法是错误的吗?我哪里错了?

0 个答案:

没有答案