Swizzled my first selector this morning
1278600
I need to make it a bit more deliberate use of the swizzle, but it solves my weird bug. If you present a SFSafariViewController it will remove everything behind it from the view heirarchy. In this case, the rootViewController.
1278606
However, the onChange() modifier isn’t called while offscreen… so programmatic dismissal driven by that modifier would fail to dismiss the browser. One simple Bool, but it’s overridden by subclassing and one cannot simply subclass a private type.
1278608
Selective method swizzling through an Objective-C category was the only real option I could think of. Despite avoiding swizzling for years, it’s a harmless modification so I’m kinda okay with it.
1278609
Fun to implement stuff I’ve only read about, really showed me some pitfalls. Particularly after digging through some of the details in header files [developer.limneos.net]
1278611
Swizzling... fizzled ugh
1278677
Well, swizzling kinda worked but would apply changes on a class level. What I ended up going with is called isa pointer swizzling [stackoverflow.com], and I think it might be how they manage class clusters like NSArray in Objective-C land.
1278863
In this one case, I have a dummy class that inherits from the same public base class and implements the needed property override. Using object_setClass seems to allow using my overridden method while others are forwarded to the original implementation.
1278865
It’s exactly what I was hoping for, any swizzling is done to a single instance and method at runtime. So far no strange side effects, next problem!

Packing…
1278866
Extracted everything into a separate submodule and documented the actual swizzling solution for future me. I'm really happy with the outcome, sits right along side the existing API but with a few more niceties and parameters.
1278990
For example, item identity is provided as a KeyPath parameter (like a ForEach) instead of a protocol requirement. Alerts have onDismiss callbacks, and you can present UIViewControllers in a ViewBuilder like fashion.
1278991
Makes presenting a website inline easy:

.sheet(item: $url, id: \.self, from: backing, on: queue) { url in
if url.isFileURL {
Text("...")
} else {
SFSafariViewController(url: url)
}
}

Also, notice Views along side UIViewControllers.
1278992