Skip to content

fix(sdk): repair iOS pasteboard wrapper + compile Swift for iOS in CI (0.2.3)#187

Merged
saltyskip merged 4 commits into
mainfrom
fix/sdk-ios-build
Jun 3, 2026
Merged

fix(sdk): repair iOS pasteboard wrapper + compile Swift for iOS in CI (0.2.3)#187
saltyskip merged 4 commits into
mainfrom
fix/sdk-ios-build

Conversation

@saltyskip
Copy link
Copy Markdown
Owner

sdk-v0.2.2 shipped a non-compiling Swift wrapper — consumers hit 'DetectedPatterns' is not a member type of UIPasteboard in Xcode. This fixes it (as 0.2.3) and closes the CI gap that let it ship.

What broke

DeferredDeepLink.swift used UIPasteboard.DetectedPatterns (plural); the UIKit member type is DetectedPattern (singular). It compiled nowhere — but nothing caught it:

  • Mobile SDK CI runs on Ubuntu and only does cargo fmt/clippy/test, which never touches the hand-written Swift.
  • A plain swift build on macOS skips it too — DeferredDeepLink.swift is under #if canImport(UIKit), only true when building for iOS.
  • The release build (build_xcframework.sh) compiles the Rust XCFramework and regenerates bindings but does not compile the Swift wrappers — so the release "succeeded" and shipped broken Swift.

Fix

  1. Set<UIPasteboard.DetectedPattern> (singular).
  2. New ios-build CI job (macos-15): builds the XCFramework, points Package.swift at it, and compiles the package for generic/platform=iOS via xcodebuild. A wrong UIKit type — or any Swift-wrapper error — now fails the PR. (Workflow also self-triggers on its own changes.)
  3. Bump to 0.2.3 (0.2.2 is already released) so merging cuts a working sdk-v0.2.3.

The new CI job runs on this PR, so it validates the fixed wrapper compiles for iOS before merge.

Follow-up (not in this PR)

The release workflow shipping broken Swift is a real hole — worth adding the same iOS compile to mobile-sdk-release.yml's build-ios as defense-in-depth. Kept out here to avoid risking the 0.2.3 release on a release-workflow change; happy to file/do it separately.

🤖 Generated with Claude Code

saltyskip and others added 2 commits June 2, 2026 18:38
…ft in CI

The deferred-deep-link pasteboard helper used `UIPasteboard.DetectedPatterns`
(plural), which isn't a UIKit type — the member type is `DetectedPattern`
(singular). It compiled nowhere, but CI never noticed: the Mobile SDK CI job
runs on Ubuntu and only does `cargo fmt/clippy/test`, which never compiles the
hand-written Swift wrappers. A plain `swift build` on macOS misses them too —
`DeferredDeepLink.swift` is under `#if canImport(UIKit)`, only true when
building for an iOS destination.

- Fix the type to `Set<UIPasteboard.DetectedPattern>`.
- Add an `ios-build` CI job (macos-15) that builds the XCFramework (regenerating
  the UniFFI bindings) and compiles the package for `generic/platform=iOS` via
  xcodebuild — so a wrong UIKit type, or any Swift-wrapper error, fails the PR
  instead of surfacing when a consumer builds in Xcode.
- Self-trigger the workflow on changes to its own file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sdk-v0.2.2 shipped with a non-compiling Swift wrapper (the
`UIPasteboard.DetectedPattern` fix in the previous commit), because the release
build never compiled the hand-written Swift. 0.2.2 is already released, so cut
0.2.3 with the fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rift Ready Ready Preview, Comment Jun 3, 2026 1:57am

Request Review

The type is DetectionPattern, not DetectedPattern/DetectedPatterns. Confirmed
by the new ios-build CI job, which compiled the wrapper for iOS and surfaced
the real symbol from UIKit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The previous attempt assumed an async `detectPatterns(for:)` that doesn't
exist, and the iOS 14 `DetectionPattern` overload is deprecated. Switch to the
non-deprecated iOS 15 keypath form — `detectPatterns(for: [\.probableWebURL])`
over `Set<PartialKeyPath<UIPasteboard.DetectedValues>>` — bridged to async via
`withCheckedThrowingContinuation`, and bump the SDK's iOS minimum to 15 in
Package.swift.

`detectPatterns` (not `detectValues`) is deliberate: it reports which patterns
are present without exposing the contents, so iOS does not show the paste
disclosure — `detectValues` returns the values and would.

Verified locally: built the XCFramework and compiled the whole RiftSDK package
for `generic/platform=iOS` — BUILD SUCCEEDED. Also stop piping the CI
xcodebuild step through `tail`, which had hidden the real `error:` lines.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@saltyskip saltyskip merged commit 85528b4 into main Jun 3, 2026
8 checks passed
@saltyskip saltyskip deleted the fix/sdk-ios-build branch June 3, 2026 02:04
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.

1 participant