-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
I have this Swift protocol:
@objc public protocol ViewControllerAPI {
func foo()
}
A ObjC class adopts the protocol:
@interface ViewController : UIViewController <ViewControllerAPI>
@end
In anther Swift file, when I try to call the protocol method foo
, Xcode complains ViewController
has no member foo
.
class Presenter {
func present() {
ViewController().foo() // Value of type 'ViewController' has no member 'foo'
}
}
Reproduction
@objc public protocol ViewControllerAPI {
func foo()
}
@interface ViewController : UIViewController <ViewControllerAPI>
@end
class Presenter {
func present() {
ViewController().foo() // Value of type 'ViewController' has no member 'foo'
}
}
Expected behavior
ViewController().foo()
works
Environment
6.2
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels