fix(sdk): repair iOS pasteboard wrapper + compile Swift for iOS in CI (0.2.3)#187
Merged
Conversation
…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>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sdk-v0.2.2shipped a non-compiling Swift wrapper — consumers hit'DetectedPatterns' is not a member type of UIPasteboardin Xcode. This fixes it (as 0.2.3) and closes the CI gap that let it ship.What broke
DeferredDeepLink.swiftusedUIPasteboard.DetectedPatterns(plural); the UIKit member type isDetectedPattern(singular). It compiled nowhere — but nothing caught it:cargo fmt/clippy/test, which never touches the hand-written Swift.swift buildon macOS skips it too —DeferredDeepLink.swiftis under#if canImport(UIKit), only true when building for iOS.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
Set<UIPasteboard.DetectedPattern>(singular).ios-buildCI job (macos-15): builds the XCFramework, pointsPackage.swiftat it, and compiles the package forgeneric/platform=iOSviaxcodebuild. A wrong UIKit type — or any Swift-wrapper error — now fails the PR. (Workflow also self-triggers on its own changes.)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'sbuild-iosas 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