You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the major reasons the Wrapper suffix was implemented is so that when generating the given files, the names wouldn't clash. However, this would no longer be necessary when going from Swift to Objective C.
Therefore, this issue proposes making use of @objc namespacing so that the names can be reverted back to their original names when exporting to Objective-C.
That is, a declaration MyDecl converted to MyDeclWrapper can have @objc(MyDecl):
// a.swift
publicstructMyDecl{
// properties and methods...
}
// b.swift
@objc(MyDecl)publicclassMyDeclWrapper:NSObject{
// properties and methods...
}
In Objective-C, the declaration will be named MyDecl (no name collisions, since C-family of languages use file-based imports)
SWIFT_CLASS_NAMED("ObjCTestBench")
@interface MyDecl: NSObject
// properties and methods
@end
If agreed upon, the generation logic would be refactored to using @objc(<original-name>) rather than just @objc.