madsmtm / objc2

Bindings to Apple's frameworks in Rust
https://docs.rs/objc2/
MIT License
336 stars 39 forks source link

Linking against private frameworks? #501

Open NyaomiDEV opened 1 year ago

NyaomiDEV commented 1 year ago

I wonder if it is inside the scope of this project to be able to link against private frameworks (specifically MediaRemote) and to use them in a mostly-type-safe way.

silvanshade commented 1 year ago

There has been a little discussion around being able to use the header-translator (the tool icrate uses to generate the Rust definitions from the Apple frameworks) for other frameworks. For example, see item 2 at https://github.com/madsmtm/objc2/issues/429.

So far there hasn't been a lot of work toward making this practical though. In principle, I believe it should be possible now, but it would require some modification to the icrate configuration and potentially to some parts of header-translator.

The situation should improve in the next few months hopefully, once there has been more progress made toward the new dependency scanning backend.

madsmtm commented 1 year ago

At some point after https://github.com/madsmtm/objc2/issues/345 we'll probably figure out a good way for translating headers not provided via. Xcode, then you should be able to just run header-translator (or whatever it'll end up being named) on your header and get a Rust library that targets that.

madsmtm commented 1 year ago

Oops, @silvanshade beat me to it, but agree with everything they said