ReviewOS

also looking at this

craft-native/craft

feat(ios): the Zig runtime, offered to a Swift-hosted app

#103
Merged glennmichael123 wants to merge feat/ios-swift-host-seam into main
7 files +868 -59
packages/zig/src/bridge_mobile_system.zigmodified+8-2
Changes to packages/zig/src/bridge_mobile_system.zig
@@ -670,9 +670,12 @@ pub const uikit = if (is_darwin) struct {
670670 /// "which is already presenting" and silently does nothing, so the
671671 /// completion handler never fires and the caller waits out its timeout.
672672 pub fn topmostViewController() !objc.id {
673 // One `orelse`, not an `orelse` plus a null check. `getWebView` used to
674 // answer a double optional, so the `orelse` unwrapped the outer level
675 // and the second line was the guard that actually ran; now the slot is
676 // a single `objc.id` and this catches both spellings of "no webview".
673677 const webview = ios_dispatch.getWebView() orelse
674678 return bridge_error.BridgeError.WebViewHandleNotSet;
675 if (webview == null) return bridge_error.BridgeError.WebViewHandleNotSet;
676679
677680 const sel_window = objc.sel_registerName("window") orelse return error.SelectorNotFound;
678681 const window = objc.msgSendId(webview, sel_window);
@@ -703,9 +706,12 @@ pub const uikit = if (is_darwin) struct {
703706 /// pre-iOS-14 `+requestReview`, which is deprecated and may be gone, and it
704707 /// is certainly not a reason to reply success having done nothing.
705708 fn keyWindowScene() !objc.id {
709 // One `orelse`, not an `orelse` plus a null check. `getWebView` used to
710 // answer a double optional, so the `orelse` unwrapped the outer level
711 // and the second line was the guard that actually ran; now the slot is
712 // a single `objc.id` and this catches both spellings of "no webview".
706713 const webview = ios_dispatch.getWebView() orelse
707714 return bridge_error.BridgeError.WebViewHandleNotSet;
708 if (webview == null) return bridge_error.BridgeError.WebViewHandleNotSet;
709715
710716 const sel_window = objc.sel_registerName("window") orelse return error.SelectorNotFound;
711717 const window = objc.msgSendId(webview, sel_window);