Swift Doesn’t See ObjC id<Protocol> Properties When Protocol is Defined in a Swift Package

Hello! Going through the process of modularizing some code from a mixed ObjC/Swift codebase by putting into local packages. Facing an issue where Swift is not recognizing an ObjC id<Protocol> property where the Protocol was defined in Swift in a Swift Package.



@objc public protocol SampleProtocol: NSObjectProtocol {
    func doSomething()



@protocol SampleProtocol;

@interface ViewController : UIViewController

@property id<SampleProtocol> sampleProperty;



import SamplePackage

extension ViewController {
    func doSomethingElse() {
        sampleProperty.doSomething() // Error: `Cannot find 'sampleProperty' in scope` 

The project compiles fine without the swift usage so I believe it has been correctly set up otherwise.

Here is a sample project with the setup: GitHub - nikitaame/SampleApp