Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.
/ BoringTwitterClient Public archive

An excercise in using Rust in an iOS project

Notifications You must be signed in to change notification settings

nesium/BoringTwitterClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boring "Twitter" Client

What is it?

This is an excercise in using Rust in an iOS project to demonstrate the possibility of future cross-platform code sharing.

The project uses Viaduct to perform requests from Rust and sends the results to Swift as ProtoBuffer objects, as described in Crossing the Rust FFI frontier with Protocol Buffers.

The results are then displayed using SwiftUI.

It doesn't really work against the Twitter API, but simply against some Mock Service instead. You get the idea.

Prerequisites

To build this thing you'll need…

  • Swift
  • the protoc compiler and the Swift code generator, as described here
  • Rust (I'm using the 1.56.0 stable toolchain) and support for iOS relevant architectures (aarch64-apple-ios, aarch64-apple-ios-sim, x86_64-apple-ios)

How to build

After you've installed the required prerequisites, run make in the root folder to build the Rust library and then you should be able to compile the Xcode project.