1

I have a 3 files:

PLThreadViewController.swift

@objc protocol PLThreadViewDelegate {
    func threadViewControlledWillDismiss(threadViewController: PLThreadViewController)
}

class PLThreadViewController: UIViewController {}

PLMessagesTableViewController.h

#import <UIKit/UIKit.h>

@interface PLMessagesTableViewController : UITableViewController <PLThreadViewDelegate>

@end

The problem is: Cannot find the protocol declaration for PLThreadViewDelegate

When i try to add:

#import "Module-Swift.h"

then:

Module-Swift.h file not found. The name of module is very correct. I read about spaces, underscores in the name and so on.

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358

1 Answers1

0

Did Xcode create a bridging header for you? If so, look at the naming Xcode uses there and that will clue you in on how your "-Swift.h" file is named. So if your bridging header is named My_Project-Bridging-Header.h, your auto-generated Swift header will be My_Project-Swift.h.

BJ Miller
  • 1,536
  • 12
  • 16
  • yes, it did. The name of file is good. It works in other places vey well. – Bartłomiej Semańczyk Jan 10 '15 at 00:30
  • Check target membership of the file that can't see the protocol, as well as the file with the protocol. – BJ Miller Jan 10 '15 at 00:33
  • Select the file(s) you want to verify in the Project Navigator (left-hand pane) and then show the File Inspector (right-hand pane) to verify Target membership. This image should help: [Check membership](https://dl.dropboxusercontent.com/u/17455146/Check%20target%20membership.png) – BJ Miller Jan 10 '15 at 16:12
  • But the problem is that my file is not .swift, but .h instead. In my case that target membership checkbox is not clickable as every checkbox in .h file – Bartłomiej Semańczyk Jan 12 '15 at 13:27
  • You have to check the .m file's target membership. For some reason the .h file isn't what you check. – BJ Miller Jan 12 '15 at 13:56