Why are only @objc marked methods visible in objective C

I was going through this apple documention and it states, "By default, the generated header contains interfaces for Swift declarations marked with the public or open modifier", however, In my Xcode project, the public methods are not visible in the objective C code, and only the methods that are marked with @objc are visible. Is there some problem in my code or Is this a bug?

Replies

I think this is a bug in the docs. The rules for how Swift exports methods to Objective-C changed at some point [1], and it looks like that section of the doc never got rewritten.

Given that this doc is on the Apple Developer website, I recommend that you file a bug about this there.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] IIRC it was SE-0160.