Closed chinedufn closed 7 months ago
Swift Option and Option<&str>
This commit adds support for passing Option<String> to and from extern "Swift" functions, as well as for passing Option<&str> to extern "Swift" functions.
Option<String>
extern "Swift"
Option<&str>
For example, the following is now possible:
#[swift_bridge::bridge] mod ffi { extern "Swift" { fn opt_string_function(arg: Option<String>) -> Option<String>; fn opt_str_function(arg: Option<&str>); } }
Note that you can not yet return -> Option<&str> from Swift.
-> Option<&str>
This is an uncommon use case, so we're waiting until someone actually needs it.
Swift Option and Option<&str>
This commit adds support for passing
Option<String>
to and fromextern "Swift"
functions, as well as for passingOption<&str>
to extern "Swift" functions.For example, the following is now possible:
Note that you can not yet return
-> Option<&str>
from Swift.This is an uncommon use case, so we're waiting until someone actually needs it.