Git Product home page Git Product logo

ios-app-rs's Introduction

Proof of concept: iOS app written in pure Rust

To Run

The heavy lifting is done by objc-derive.

objc-derive is a proc macro crate to help:

  • Exposing objc objects/methods to Rust
  • Implementing objc's selector in pure Rust

Notes

Recently I looked into how to use Rust to write iOS apps. Most articles describe the hybrid approach of using Rust via FFI, where you use Rust for the core logic and Swift/ObjC/Flutter for the UI. Using 2 languages + FFI can be clumsy and error prone, so I was looking for writing the whole app in Rust.

A few things I learned along the way:

  • The closet thing I found is cacao, which has a very preliminary iOS support. Proved defintely we can write iOS apps with Rust only though.
  • Based on cacao code, I created objc-derive to help with exposing UIKit to Rust. This repo is an example of interacting with UIKit via objc-derive.
  • Although it works, UIKit in Rust is super verbose.
  • iced runs, but kinda buggy with iOS. I saw some intermittent crashes in real devices. It looks like something
  • iced + objc-derive is an interesting combo. You can write the UI with iced and interact with iOS with objc-derive

ios-app-rs's People

Contributors

wooden-worm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.