> How is type safety handled? It looks like msg_send itself isn't type safe, but there are hand-written bindings… is that right?
Correct. msg_send operates on objc::runtime::Object references. The handwritten bindings use the impl_objc_class macro referenced in the post to define separate types for different Objective-C classes, and make messaging the wrong type of object a compile-time rather than a runtime error.
You can take either approach. I opted to do it in code[0] as a personal preference since it reduced the amount of time spent jumping between Xcode and Vim, but creating a xib or storyboard and referencing it from Rust using NSBundle resources is just as possible. Maybe I should add examples of using resources to the code samples in the blog post. Thanks!
Alcatraz isn't a CocoaPods wrapper, it is an installer for Xcode customizations like plugins and color schemes. You can use it to install a CocoaPods Xcode plugin to handle installing and updating pods though: https://github.com/kattrali/cocoapods-xcode-plugin
The objc::declare module includes ClassDecl, which enables registering a new Objective-C class.
objc::declare documentation: http://sasheldon.com/rust-objc/objc/declare/index.html
Example usage: https://github.com/kattrali/rust-mac-app-examples/blob/maste...
> How is type safety handled? It looks like msg_send itself isn't type safe, but there are hand-written bindings… is that right?
Correct. msg_send operates on objc::runtime::Object references. The handwritten bindings use the impl_objc_class macro referenced in the post to define separate types for different Objective-C classes, and make messaging the wrong type of object a compile-time rather than a runtime error.
The impl_objc_class macro implements the ObjCClass and PartialEq traits for a new type: https://github.com/kattrali/rust-mac-app-examples/blob/maste...