Xcode의 Swift 인터페이스에서 Objective-C 클래스의 싱글 톤 메서드 정의를 사용할 수없는 이유에 대한 문서를 찾고있었습니다.Objective C 스위프트 인터페이스에서 사용할 수없는 싱글 톤 메서드
목적-C 클래스는 스위프트 인터페이스, 그 내가 스위프트에 sharedAccessor() 싱글 방법을 볼 것으로 예상하고있어이
/**
* A general accessor across the sample App to remove the dependency of QPSLibraryManager from resusable components.
*/
open class QPSSharedAccessor : NSObject {
/**
* Required by QPSLibraryManager and some UI components.
*/
open var qpsConfiguration: QPSApplicationConfiguration!
/**
* Provides Commands to app
*/
open var appController: QPSAppController!
/**
* Returns access to a configuration manager
*/
open func configurationManager() -> QPSConfigurationManager!
}
같이 정의 만에이
/**
* A general accessor across the sample App to remove the dependency of QPSLibraryManager from resusable components.
*/
@interface QPSSharedAccessor : NSObject
/**
* Required by QPSLibraryManager and some UI components.
*/
@property (nonatomic, strong) QPSApplicationConfiguration *qpsConfiguration;
/**
* Provides Commands to app
*/
@property (nonatomic, strong) id<QPSAppController> appController;;
/**
* Shared singleton.
*/
+ (instancetype)sharedAccessor;
/**
* Returns access to a configuration manager
*/
- (QPSConfigurationManager *)configurationManager;
@end
과 같이 정의된다 그것은 당신이 볼 수있는 것처럼 실종되었다. 별도의 swift 파일에서 해당 메서드를 호출하면 sharedAccessor() 메서드가 존재하지 않는다는 컴파일러 오류가 발생합니다. 스위프트로 모든 것을 변환하는 것은 실용적이지 않습니다. 이 문제를 해결하기위한 조언?