Objective-C クラスを使用する必要がある Swift フレームワークを作成しています。だから私はこのリンクを通った。これは私のフレームワークの公開ヘッダーです:
#import <UIKit/UIKit.h>
//! Project version number for Test.
FOUNDATION_EXPORT double TestVersionNumber;
//! Project version string for Test.
FOUNDATION_EXPORT const unsigned char TestVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Test/PublicHeader.h>
#import <arpa/inet.h>
#import <ifaddrs.h>
#import <netdb.h>
#import <sys/socket.h>
#import <MyTest/MPAppDelegateProxy.h>
クラスMPAppDelegateProxyで、作成したクラスを使用する必要がSwift
あります。これは :
#import "MPAppDelegateProxy.h"
#import "MyTest.h"
@implementation MPAppDelegateProxy
+ (void)proxyAppDelegate {
[MPGlobal MPLog:@"App delegate not set, unable to perform automatic setup." file:@"MPAppDelegateProxy.m" function:@"proxyAppDelegate" line:32];
// rest of code
}
MPGlobalは私のSwift
クラスの 1 つです。しかし、私は得ています:
宣言されていない識別子「MPGlobal」の使用
注: MPGlobal@objC
の前に追加しました。