Anyone here seriously using Rust for IOS development? Where did you learn how to do it?

59 points codedcosmos 23 comments

I've been porting a custom engine written in Rust to apple platforms because that kind of low level software engineering is extraordinarily fun to me. I've managed to get it working well on macOS. I'm currently using glfw and metal.

I'm finding the jump to IOS is one of the hardest engineering problem I've ever faced. I've picked up quite a bit I made my own .app bundling tool (I can open source this, but I suggest most people use cargo-bundle), learnt about how apple's very unique method of launching apps, Spent a lot of time looking through objc2 examples (Shoutout to u/madsmtm who's work on objc2 is incredible).

And yet I'm still having trouble creating a window, then creating an NsView for a CAMetalLayer. I'm also still unsure how all this works with the UIApplication. I get the impression it starts an event loop? And that event loop effectively takes up the whole main thread? I was hoping to simply have a render thread and a tick thread.

Bevy has a working iOS example, but my attempts to understand what it's doing have failed. Winit seems like what I want (it creates the UIApplication for me, and a non-metal example), but I don't know how to start using metal after that.

I am not really expecting answers to all of these questions. Instead I'm hoping there are wgpu/winit/objc2/bevy developers or others in this subreddit who can point me to tutorials or examples or guides or reading material. I want to learn how they figured out all this stuff and wrote the libraries I mentioned here.