bevy_ios_alerts 0.9.0

Bevy plugin to request ios native UIAlert popups
Documentation

bevy_ios_alerts

crates.io docs.rs discord

Bevy plugin to easily integrate iOS's native UIAlerts API into a Bevy application.

Talks to UIKit directly via objc2 - no Swift package or XCode setup required.

demo

demo from our game using this crate: zoolitaire.com

Instructions

  1. Add Rust dependency
  2. Setup Plugin

1. Add Rust dependency

cargo add bevy_ios_alerts

or

bevy_ios_alerts = { version = "0.9" }

2. Setup Plugin

Initialize Bevy Plugin:

app.add_plugins(bevy_ios_alerts::IosAlertsPlugin);

Trigger Alert in your application code:

fn system_triggerin_alerts(mut events: MessageWriter<IosAlert>) {

    events.send(IosAlert::Message {
        title: String::from("title"),
        msg: String::from("msg"),
        button: String::from("ok"),
    });

    events.send(IosAlert::Dialog {
        title: String::from("title"),
        msg: String::from("this is a dialog with multiple buttons"),
        button_yes: String::from("absolutely yes"),
        button_no: String::from("no no no"),
    });

    events.send(IosAlert::Input {
        title: String::from("title"),
        msg: String::from("input box"),
        button: String::from("ok"),
        placeholder: String::from("placeholder"),
    });
}

fn process_alert_response(mut events: MessageReader<IosAlertResponse>) {
    for e in events.read() {
        info!("incoming alert response: {e:?}");
    }
}

Our Other Crates

Bevy version support

bevy crate
0.19 0.9,main
0.18 0.7,0.8
0.17 0.6
0.16 0.5
0.15 0.3,0.4
0.14 0.2
0.13 0.1

License

All code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer.

Your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.