Skip to content

add dockkit bindings#57

Open
yury wants to merge 1 commit into
mainfrom
swift
Open

add dockkit bindings#57
yury wants to merge 1 commit into
mainfrom
swift

Conversation

@yury

@yury yury commented May 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new swift interop module (Swift ABI calls via AArch64 inline assembly) and uses it to introduce initial DockKit.framework bindings behind a new dk feature, plus an iOS example demonstrating basic usage.

Changes:

  • Introduces cidre::swift (ABI helpers + retained wrappers for Swift String, Array, and class objects).
  • Adds cidre::dk DockKit bindings (AccessoryManager, Accessory, enums, error constants, and async StateChanges plumbing).
  • Updates crate features/examples/build configuration to support Swift/DockKit linking and an example binary.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
cidre/src/swift/abi.rs New AArch64 Swift runtime/ABI call shims (inline assembly).
cidre/src/swift/array.rs Retained wrapper for native Swift Array storage + helpers/tests.
cidre/src/swift/int.rs Defines Swift Int/UInt type aliases.
cidre/src/swift/object.rs Retained wrapper for Swift class object references.
cidre/src/swift/string.rs Retained wrapper for Swift String ABI values + small-string constructor/tests.
cidre/src/swift.rs Exposes the Swift interop module and re-exports key types.
cidre/src/lib.rs Wires in dk and swift modules behind platform/feature cfgs.
cidre/src/dk.rs New DockKit module surface + basic tests.
cidre/src/dk/error.rs DockKitError constants + hash accessor via Swift ABI.
cidre/src/dk/accessory_manager.rs DockAccessoryManager bindings (shared, properties, throwing getter).
cidre/src/dk/accessory.rs Main DockAccessory bindings, resilient enum helpers, and async StateChanges task glue.
cidre/examples/dock-kit/main.rs Example program demonstrating DockKit usage and printing status/changes.
cidre/Cargo.toml Adds dk and swift features; registers dock-kit example.
cidre/build.rs Adds Swift runtime rpath when swift feature is enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cidre/src/swift/abi.rs
Comment on lines +96 to +101
in("x1") core::ptr::null_mut::<()>(),
in("x2") future_result_type,
in("x3") function,
in("x4") context,
in("x5") initial_context_size,
lateout("x1") initial_context,
Comment thread cidre/src/swift/abi.rs
Comment on lines +118 to +123
asm!(
"bl {f}",
f = sym swift_task_create,
inlateout("x0") flags => task,
in("x1") core::ptr::null_mut::<()>(),
in("x2") future_result_type,
Comment thread cidre/src/swift/abi.rs
Comment on lines +287 to +288
in("x1") element,
lateout("x1") elements,
Comment thread cidre/src/swift/abi.rs
Comment on lines +445 to +446
in("x0") object,
lateout("x0") word0,
Comment thread cidre/src/swift/abi.rs
Comment on lines +545 to +546
in("x0") value,
lateout("x0") word0,
Comment thread cidre/src/dk/accessory.rs
tracking_button_enabled,
}));

abi::destroy_value(task.result.as_ptr().cast(), task.payload_metadata);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants