Swift在从Objective C桥接到Swift时没有显示返回类型。如何获得返回值?

时间:2018-02-09 11:54:01

标签: objective-c swift

当从Objective C桥接到Swift时,Swift没有显示函数的返回类型。这里有什么问题以及如何获得返回值?

// Objective C

#import <Foundation/Foundation.h>

@interface Test: NSObject

+(BOOL)testName :(NSString*)name challenge:(NSString**)challenge error:(NSError**)error;

@end

// Swift
import Foundation

open class Test : NSObject {

    open class func testName(_ name: String!, challenge: AutoreleasingUnsafeMutablePointer<NSString?>!) throws
}

Click on this link to get my scenario's reference snapshot in Xcode assistant editor

0 个答案:

没有答案