Repository navigation
v0.5.0
ABIBridge v0.5.0
This release expands Swift invocation, adds SwiftUI integration, and clarifies Objective-C dispatch and ownership APIs. Swift 6.3 remains the minimum toolchain requirement.
Breaking Changes
- Rename Swift
NativeMethodtoNativeBoundObjCMethodto make its retained receiver and Objective-C dispatch explicit. - Replace C++/Objective-C++
abi_bridge::objc_method(...)andobjc_method_handlewithabi_bridge::bound_objc_implementation<Signature>. - Replace
ABIResolutionError.signatureMismatch(expected:found:)withsignatureMismatch(SignatureMismatch). Update error handling to read the structured payload'sdeclaration,position,expected, andfoundfields. Known Objective-C lookup and preparation failures now useABIResolutionErrorinstead of nativeNSErrorvalues.
New Features
- Invoke supported Swift async and throwing functions, methods, initializers, and getters, including typed throws and caller-isolated or concurrent async conventions.
- Pass capturing Swift closures to native code and call returned closures, including synchronous, throwing, and async signatures.
- Pass
Array, optionalStringandArrayvalues,Any, and supported imported protocol existentials with Swift ownership semantics. - Describe managed Swift structs, enums, and formally indirect values through
ABIBridgeSwiftValue. - Express
inout, borrowing, and consuming arguments with typed wrappers for synchronous and async invocation. - Receive owned opaque results from nongeneric Swift declarations through
NativeSwiftOpaqueValue. - Add the optional
ABIBridgeSwiftUIproduct andNativeSwiftViewto display nativesome Viewresults while retaining their values and implementation images. - Prepare reusable Objective-C messages independently of receiver instances with
NativeObjCMethod, and acceptSelectorvalues across invocation and hook APIs.
Generic declarations requiring additional metadata or witness arguments still need compiled adapters. These additions do not extend managed hooks to async or throwing targets.
Improvements
- Resolve Swift members on private classes and instantiated generic receivers, including inherited members and applicable same-type constrained extensions.
- Marshal Objective-C structures from complete runtime type encodings, including
UIEdgeInsets, nested structures, and fixed-size array fields, using caller-selected compatible Swift types. - Provide default conversions for
BitwiseCopyabletypes conforming toABIBridgeValue, and support compatible native tail padding.
Bug Fixes
- Resolve Swift declarations containing both named and unnamed argument labels correctly.
- Preserve the originally requested Swift receiver in missing-member errors.
- Keep automatic symbol lookup usable while unrelated images initialize, and avoid caching incomplete search results.
Documentation
- Add guides for Swift closures, async and throwing calls, value layouts, argument ownership, existential and opaque values, and SwiftUI integration. Update Objective-C examples for the revised dispatch APIs.
Full Changelog: v0.4.0...v0.5.0