I wrote SearcherProtocol
in Swift and need to implement an Objective-C class FileSearcher
which has to use this protocol.
So I tried this:
#import <Foundation/Foundation.h>
@interface FileSearcher : NSObject <SearcherProtocol>
// ... class content
@end
The compiler tells me
Cannot find protocol declaration for 'SearcherProtocol'
The corresponding bridged header file (modulename-Swift.h
) is being imported within FileSearcher.m
.
Importing SearcherProtocol
into FileSearcher.h
throws another compiler error: module name-swift.h file not found
Does anybody have any clue what I'm doing wrong?
I'm using Xcode 6 Beta 5.
Edit
Here is the protocol declaration in Swift:
@objc protocol SearcherProtocol
{
var searchNotificationTarget: SearchCompletedProtocol? { get }
var lastSearchResults: [AnyObject] { get set }
func search(searchParam: String, error: NSErrorPointer) -> Bool
}
And the SearchCompletedProtocol:
@objc protocol SearchCompletedProtocol
{
func searchCompletedNotification(sender: AnyObject!)
}
@objc
flag? – Sulthan