Build your first Rust iOS GUI app with Fission

Create café pickup orders, mark them ready and record handoff with separate reducers and counts derived from the actual queue.
iOS

What you will build

Run one empty-by-default café app on iOS and Web without relying on browser-seeded tickets.
Validate actual pickup-name and item input
Keep duplicate ready actions from accidentally recording a handoff
Filter collected tickets without deleting their app-owned status
A pickup queue needs to distinguish an order being prepared from one waiting at the counter. Those states are not interchangeable: marking a drink ready must not also record that its customer collected it.
We will build a small café board with an actual order-entry form. It starts empty on both native and Web targets. Enter the customer and items yourself, then move the order through preparation, readiness and handoff. The counts come from those records rather than a second set of editable totals.
Orders stay in memory for this session. Payment, durable storage and a connected order service are outside this first app; none is implied by recording a handoff.
Start from a new project (optional)

Create an iOS project

Complete Rust and iOS setup first. On macOS, create the app and add its target:
cargo install cargo-fission
fission init ios-build-your-first-rust-ios-gui-app-with-fission
cd ios-build-your-first-rust-ios-gui-app-with-fission
fission add-target ios --project-dir .
cargo add serde_yaml
Keep the generated src/main.rs. The shared library below replaces the starter app for every normal launch. The browser preview is not seeded with orders which the iOS app cannot create.

Run the finished example

fission run --target ios --project-dir .

1. Put the order rules beside the records

CafeState owns orders and their stable session IDs. Each card receives only its ID and looks up the current record. The entry draft and display filter belong to the screen because they do not change whether an order has been prepared or collected.
The two status transitions are intentionally separate and idempotent. Replaying “Mark ready” whilst the order is already ready does not hand it over. This matters with quick repeated input; a generic “advance to whatever comes next” action can record a consequence the person did not intend.
{"id":"fission-tabs-1","tabs":[{"index":0,"label":"src/app.rs","value":"src-app-rs"},{"index":1,"label":"src/app/state.rs","value":"src-app-state-rs"},{"index":2,"label":"src/app/card.rs","value":"src-app-card-rs"},{"index":3,"label":"src/app/screen.rs","value":"src-app-screen-rs"},{"index":4,"label":"src/i18n.rs","value":"src-i18n-rs"},{"index":5,"label":"src/lib.rs","value":"src-lib-rs"},{"index":6,"label":"preview/lib.rs","value":"preview-lib-rs"},{"index":7,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"},{"index":8,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}]}
{"id":"fission-tabs-1","index":0,"label":"src/app.rs","value":"src-app-rs"}
mod card;
mod screen;
pub mod state;
pub use screen::CafeScreen;
pub use state::CafeState;
{"id":"fission-tabs-1","index":1,"label":"src/app/state.rs","value":"src-app-state-rs"}
use fission::prelude::*;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OrderStatus {
    Preparing,
    Ready,
    Collected,
}
impl OrderStatus {
    pub fn label_key(self) -> &'static str {
        match self {
            Self::Preparing => "order.preparing",
            Self::Ready => "order.ready",
            Self::Collected => "order.collected",
        }
    }
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PickupOrder {
    pub id: u64,
    pub customer: String,
    pub items: String,
    pub status: OrderStatus,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CafeState {
    pub orders: Vec<PickupOrder>,
    pub next_id: u64,
    pub locale: Locale,
}
impl Default for CafeState {
    fn default() -> Self {
        Self {
            orders: Vec::new(),
            next_id: 1,
            locale: Locale::from("en-US"),
        }
    }
}
impl GlobalState for CafeState {}

pub fn add_order(state: &mut CafeState, customer: &str, items: &str) -> bool {
    let (customer, items) = (customer.trim(), items.trim());
    if customer.is_empty() || items.is_empty() {
        return false;
    }
    let Some(next_id) = state.next_id.checked_add(1) else {
        return false;
    };
    state.orders.push(PickupOrder {
        id: state.next_id,
        customer: customer.to_owned(),
        items: items.to_owned(),
        status: OrderStatus::Preparing,
    });
    state.next_id = next_id;
    true
}

pub fn mark_ready(state: &mut CafeState, id: u64) {
    if let Some(order) = state.orders.iter_mut().find(|order| order.id == id) {
        if order.status == OrderStatus::Preparing {
            order.status = OrderStatus::Ready;
        }
    }
}
pub fn collect_order(state: &mut CafeState, id: u64) {
    if let Some(order) = state.orders.iter_mut().find(|order| order.id == id) {
        if order.status == OrderStatus::Ready {
            order.status = OrderStatus::Collected;
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn order_requires_both_inputs_and_gets_its_own_identity() {
        let mut state = CafeState::default();
        assert!(!add_order(&mut state, " ", "Flat white"));
        assert!(add_order(&mut state, "Maya", "Flat white"));
        assert!(add_order(&mut state, "Maya", "Flat white"));
        assert_ne!(state.orders[0].id, state.orders[1].id);
    }
    #[test]
    fn duplicate_ready_action_does_not_record_a_handoff() {
        let mut state = CafeState::default();
        add_order(&mut state, "Maya", "Flat white");
        let id = state.orders[0].id;
        collect_order(&mut state, id);
        assert_eq!(state.orders[0].status, OrderStatus::Preparing);
        mark_ready(&mut state, id);
        mark_ready(&mut state, id);
        assert_eq!(state.orders[0].status, OrderStatus::Ready);
        collect_order(&mut state, id);
        collect_order(&mut state, id);
        assert_eq!(state.orders[0].status, OrderStatus::Collected);
    }
}
{"id":"fission-tabs-1","index":2,"label":"src/app/card.rs","value":"src-app-card-rs"}
use super::state::{collect_order, mark_ready, CafeState, OrderStatus};
use fission::prelude::*;

fission_component! {
    pub PickupOrderCard<CafeState> { props { order_id: u64 } }
    view(card, state, cx) {
        let tokens = &cx.view.env().theme.tokens;
        let order = state.orders.iter().find(|order| order.id == card.order_id);
    } => if let Some(order) = order {
        SemanticsRegion(
            identifier: Some(format!("pickup.order.{}", card.order_id)),
            child: Container(Column(gap: tokens.spacing.s, children: [
                Text(format!("#{} · {}", order.id, order.customer))
                    .weight(tokens.typography.font_weight_semibold),
                Text(order.items.clone()),
                Text(cx.tr(order.status.label_key())),
                if order.status == OrderStatus::Preparing {
                    Button(
                        child: Text(cx.tr("order.mark_ready")), key: "mark-ready",
                        on_press: reduce { mark_ready(state, card.order_id); },
                    )
                } else if order.status == OrderStatus::Ready {
                    Button(
                        child: Text(cx.tr("order.collect")), key: "collect",
                        on_press: reduce { collect_order(state, card.order_id); },
                    )
                } else {
                    Text(cx.tr("order.handed_over")).color(tokens.colors.text_secondary)
                },
            ])).padding_all(tokens.spacing.m)
                .bg(tokens.colors.surface)
                .border(tokens.colors.border, 1.0)
                .border_radius(tokens.radii.medium),
        )
    } else { Text(cx.tr("order.missing")) }
}
{"id":"fission-tabs-1","index":3,"label":"src/app/screen.rs","value":"src-app-screen-rs"}
use super::card::PickupOrderCard;
use super::state::{add_order, CafeState, OrderStatus};
use fission::prelude::*;

fission_component! {
    pub CafeScreen<CafeState> {
        state {
            customer: String = String::new(),
            items: String = String::new(),
            attempted: bool = false,
            hide_collected: bool = false,
        }
    }
    view(form, state, cx) {
        let tokens = &cx.view.env().theme.tokens;
        let customer_error = (form.attempted && form.customer.trim().is_empty())
            .then(|| cx.tr("order.customer_required"));
        let items_error = (form.attempted && form.items.trim().is_empty())
            .then(|| cx.tr("order.items_required"));
        let preparing = state.orders.iter().filter(|o| o.status == OrderStatus::Preparing).count();
        let ready = state.orders.iter().filter(|o| o.status == OrderStatus::Ready).count();
        let collected = state.orders.iter().filter(|o| o.status == OrderStatus::Collected).count();
        let visible: Vec<_> = state.orders.iter()
            .filter(|o| !form.hide_collected || o.status != OrderStatus::Collected).collect();
    } => SafeArea(child: Scroll(child: Container(
        Column(gap: tokens.spacing.m, children: [
            Text(cx.tr("cafe.title")).size(tokens.typography.heading2_size),
            Text(cx.tr("cafe.explanation")),
            Row(gap: tokens.spacing.s, children: [
                Button(child: Text(cx.tr("language.english")), key: "english",
                    on_press: reduce { state.locale = Locale::from("en-US"); }),
                Button(child: Text(cx.tr("language.spanish")), key: "spanish",
                    on_press: reduce { state.locale = Locale::from("es-ES"); }),
            ]),
            FormControl(
                label: Some(cx.tr("order.customer")), required: true, error: customer_error,
                child: TextInput(value: form.customer.clone(), bind(on_input): to(form.customer)),
            ),
            FormControl(
                label: Some(cx.tr("order.items")), required: true, error: items_error,
                child: TextInput(value: form.items.clone(), bind(on_input): to(form.items)),
            ),
            Button(
                child: Text(cx.tr("order.add")), key: "add-order",
                disabled: state.next_id == u64::MAX,
                on_press: reduce {
                    form.attempted = true;
                    if add_order(state, &form.customer, &form.items) {
                        form.customer.clear();
                        form.items.clear();
                        form.attempted = false;
                    }
                },
            ),
            Text(cx.tr("cafe.summary")
                .replace("{preparing}", &preparing.to_string())
                .replace("{ready}", &ready.to_string())
                .replace("{collected}", &collected.to_string())),
            Button(
                child: Text(cx.tr(if form.hide_collected { "cafe.show_all" } else { "cafe.hide_collected" })),
                key: "filter-orders",
                on_press: reduce { form.hide_collected = !form.hide_collected; },
            ),
            if visible.is_empty() { Text(cx.tr("cafe.empty")) },
            for order in visible {
                PickupOrderCard(order.id, key: order.id)
            },
            Text(cx.tr("cafe.persistence")).color(tokens.colors.text_secondary),
        ])
    ).padding_all(tokens.spacing.l).bg(tokens.colors.background)))
}
{"id":"fission-tabs-1","index":4,"label":"src/i18n.rs","value":"src-i18n-rs"}
use fission::i18n::{Locale, TranslationBundle};
use fission::prelude::*;
use std::collections::HashMap;

pub fn create_env() -> Env {
    let mut env = Env::default();
    env.locale = Locale::from("en-US");
    for (locale, source) in [
        ("en-US", include_str!("../i18n/en-US.yaml")),
        ("es-ES", include_str!("../i18n/es-ES.yaml")),
    ] {
        let messages: HashMap<String, String> =
            serde_yaml::from_str(source).expect("valid task translations");
        env.i18n.add_bundle(TranslationBundle {
            locale: Locale::from(locale),
            messages,
        });
    }
    env
}

pub fn sync_env(state: &crate::app::CafeState, env: &mut Env) {
    env.locale = state.locale.clone();
}
{"id":"fission-tabs-1","index":5,"label":"src/lib.rs","value":"src-lib-rs"}
pub mod app;
mod i18n;

use app::{CafeScreen, CafeState};
use fission::prelude::*;

#[cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))]
pub fn run_desktop() -> anyhow::Result<()> {
    DesktopApp::<CafeState, _>::new(CafeScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
}

#[cfg(any(target_os = "android", target_os = "ios"))]
pub fn run_mobile() -> anyhow::Result<()> {
    MobileApp::<CafeState, _>::new(CafeScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
}

#[cfg(target_os = "android")]
#[no_mangle]
fn android_main(app_handle: AndroidApp) {
    let _ = MobileApp::<CafeState, _>::new(CafeScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run_with_android_app(app_handle);
}

#[cfg(target_arch = "wasm32")]
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn run_web() -> Result<(), wasm_bindgen::JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<CafeState, _>::new(CafeScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
        .map_err(|error| wasm_bindgen::JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":6,"label":"preview/lib.rs","value":"preview-lib-rs"}
mod app;
mod i18n;

use fission::prelude::*;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub fn run() -> Result<(), JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<app::CafeState, _>::new(app::CafeScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .mount("#fission-web-mount")
        .run()
        .map_err(|error| JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":7,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"}
cafe.title: "Café pickup queue"
cafe.explanation: "Enter an order, mark it ready when prepared, then record the handoff when it is collected."
cafe.summary: "{preparing} preparing · {ready} ready · {collected} collected"
cafe.show_all: "Show all orders"
cafe.hide_collected: "Hide collected orders"
cafe.empty: "No orders to show. Add an order or show the full queue."
cafe.persistence: "Orders are kept for this session only. This example does not take payment or save to an order service."
order.customer: "Customer or pickup name"
order.items: "Drinks and food"
order.customer_required: "Enter a pickup name."
order.items_required: "Enter what needs preparing."
order.add: "Add order"
order.preparing: "Being prepared"
order.ready: "Ready for pickup"
order.collected: "Collected"
order.mark_ready: "Mark ready"
order.collect: "Record handoff"
order.handed_over: "Handed to the customer."
order.missing: "This order is no longer in the queue."
language.english: "English"
language.spanish: "Español"
{"id":"fission-tabs-1","index":8,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}
cafe.title: "Pedidos para recoger"
cafe.explanation: "Introduce un pedido, márcalo como listo al prepararlo y registra su entrega al recogerlo."
cafe.summary: "{preparing} en preparación · {ready} listos · {collected} entregados"
cafe.show_all: "Mostrar todos los pedidos"
cafe.hide_collected: "Ocultar pedidos entregados"
cafe.empty: "No hay pedidos que mostrar. Añade uno o muestra toda la cola."
cafe.persistence: "Los pedidos se conservan solo durante esta sesión. El ejemplo no cobra ni guarda pedidos en un servicio."
order.customer: "Nombre para recoger"
order.items: "Bebidas y comida"
order.customer_required: "Introduce un nombre para recoger."
order.items_required: "Indica lo que hay que preparar."
order.add: "Añadir pedido"
order.preparing: "En preparación"
order.ready: "Listo para recoger"
order.collected: "Entregado"
order.mark_ready: "Marcar como listo"
order.collect: "Registrar entrega"
order.handed_over: "Entregado al cliente."
order.missing: "Este pedido ya no está en la cola."
language.english: "Inglés"
language.spanish: "Español"
{"id":"fission-tabs-1"}
Try submitting the empty form, then create two orders with the same pickup name. Both must get distinct tickets. The required-input errors belong to the actual form controls, not only a nearby caption.
Show the app preview
Hide the app preview

2. Move the actual orders through pickup

Mark one order ready and inspect all three counts. The preparing count falls whilst ready increases. Record its handoff separately; the collected count then increases. Hiding collected orders changes presentation, not the records or totals.
The reusable card has a concrete boundary, its own file and required input. It does not contain a second copy of the order. The shared state remains the authority whilst inline reduce handlers call the small domain transitions.
Interface labels come from checked-in English and Spanish bundles. Customer names and item descriptions are user data and are not translated. The active environment supplies spacing, colours and typography; this example does not recreate a design system with scattered literal sizes.
cargo test --lib
The tests exercise order input, stable IDs and repeated transitions. They do not establish that the rendered card is readable with the keyboard open.
Hide collected orders and show them again. The collected state must survive because it is app data. Change language and confirm that the customer and items remain exactly what you entered.
Show the app preview
Hide the app preview

3. Run the same board in the simulator

fission doctor ios --project-dir .
fission devices --project-dir .
fission run --target ios --project-dir .
fission test --target ios --project-dir .
fission build --target ios --project-dir . --release
To select an installed simulator, use its reported ID:
fission run --target ios --device <device-id> --project-dir .
These commands launch or package the simulator app; they do not install it on an iPhone. Follow physical iPhone installation for signing and device checks.
On a small simulator and a tablet-sized one, create a long order with the keyboard visible, reach the status actions and switch language. Check VoiceOver and larger text. Status must remain understandable without colour. Use LiveTest to automate the real journey, not only the generated host's smoke check.