Skip to content

v0.5.0

Choose a tag to compare

@lynnswap lynnswap released this 29 Sep 12:04
07110d6

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 NativeMethod to NativeBoundObjCMethod to make its retained receiver and Objective-C dispatch explicit.
  • Replace C++/Objective-C++ abi_bridge::objc_method(...) and objc_method_handle with abi_bridge::bound_objc_implementation<Signature>.
  • Replace ABIResolutionError.signatureMismatch(expected:found:) with signatureMismatch(SignatureMismatch). Update error handling to read the structured payload's declaration, position, expected, and found fields. Known Objective-C lookup and preparation failures now use ABIResolutionError instead of native NSError values.

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, optional String and Array values, 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 ABIBridgeSwiftUI product and NativeSwiftView to display native some View results while retaining their values and implementation images.
  • Prepare reusable Objective-C messages independently of receiver instances with NativeObjCMethod, and accept Selector values 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 BitwiseCopyable types conforming to ABIBridgeValue, 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