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

extern_methods! shorthand for property access #256

Closed
madsmtm opened this issue Aug 29, 2022 · 1 comment
Closed

extern_methods! shorthand for property access #256

madsmtm opened this issue Aug 29, 2022 · 1 comment
Labels
A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates enhancement New feature or request help wanted Extra attention is needed

Comments

@madsmtm
Copy link
Owner

madsmtm commented Aug 29, 2022

Some classes have a lot of simple properties; it may be interesting to have an easier way of accessing these?

Examples:

  • UIColor has a lot of class properties that return a specific UIColor instance
  • UIView has a lot of getter/setter properties
    • Difficult because some cases might use &mut self for mutation, while others might use &self
  • The x -> isX translation for BOOL properties can be kinda confusing, and would be nice to handle automatically

See also #161 (comment).

@madsmtm madsmtm added enhancement New feature or request help wanted Extra attention is needed A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates labels Aug 29, 2022
@madsmtm
Copy link
Owner Author

madsmtm commented Apr 21, 2023

Since we're autogenerating most extern_methods! declarations via. header-translator these days, I don't think it makes much sense to work towards a feature like this anymore - users can always define their own helper macro if they feel the need.

Also, extern_methods! still looks like fairly straightforward Rust syntax, which I doubt can be said of the syntax properties would have.

@madsmtm madsmtm closed this as completed Apr 21, 2023
@madsmtm madsmtm closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2023
@madsmtm madsmtm changed the title extern_class! shorthand for property access extern_methods! shorthand for property access Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant