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
Thoughts on this? These crates are frustrating to use in Rust. Adapting the Swift APIs would lead to a significantly better UX in the API.
We could offer the Objective C API in addition to the Swift API for some backwards compatibility though I'm unsure if we could keep it 100% as the types are just id aliases now.
The text was updated successfully, but these errors were encountered:
By mirror Swift APIs I don't mean use the names and types that Swift does. I more meant use the approach that Swift took in wrapping Objective C and take liberty with naming and types to better match our host language, Rust.
Naming
As an example.. instead of NSWindowStyleMask::NSClosableWindowMask, we could have WindowStyleMask::CLOSABLE; instead of, window.makeKeyAndOrderFront_(nil) we could have window.make_key_and_order_front(None).
Safety
Nearly every line of cocoa code I write needs an unsafe { .. } block when its mostly "safe" in theory. We should be able to enforce safety.
It looks like there have been a couple of attempts elsewhere to make things nicer, like in objrs.
I don't really have a definitive plan. More just musing and would love to contribute to an effort to have a better overall native iOS/macOS dev experience in Rust.
Just a random thought: we should leverage the toll-free bridging between Objective-C, Swift and CoreFoundation types in some way to minimize the work we need to do. This will also make interaction with Swift code easier.
Uh oh!
There was an error while loading. Please reload this page.
Refs #200
Thoughts on this? These crates are frustrating to use in Rust. Adapting the Swift APIs would lead to a significantly better UX in the API.
We could offer the Objective C API in addition to the Swift API for some backwards compatibility though I'm unsure if we could keep it 100% as the types are just
id
aliases now.The text was updated successfully, but these errors were encountered: