Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[swift2objc] Support Extensions #1815

Open
nikeokoronkwo opened this issue Dec 16, 2024 · 1 comment
Open

[swift2objc] Support Extensions #1815

nikeokoronkwo opened this issue Dec 16, 2024 · 1 comment

Comments

@nikeokoronkwo
Copy link
Contributor

nikeokoronkwo commented Dec 16, 2024

Extensions are a swift language feature that allows you to add methods and other nested declarations to a swift nestable declaration (struct or class). For exporting to Objective C, only classes are allowed to be extended (denoted by @interface <class-name> (SWIFT_EXTENSION(<module-name>)) in Objective C)

extension A {
  public func newFunc(p: String) {
    // function body
  }
}

They work similar to the relationship between Dart classes

Swift functionality present in an extension usually have a swiftExtension field in the generated symbol graph

@nikeokoronkwo nikeokoronkwo changed the title [swift2objc] Add Extensions [swift2objc] Support Extensions Dec 16, 2024
@liamappelbe
Copy link
Contributor

This feature sounds like ObjC's categories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants