Skip to content

Conversation

@superbigroach
Copy link


Summary

This PR fixes Swift 6 compatibility issues that prevent the SDK from building on Xcode 16. These
changes allow developers to successfully integrate CircleModularWalletsCore via SPM in projects
using Swift 6.

Problem

When building with Xcode 16 (Swift 6), the SDK fails to compile with errors like:

Swift Compiler Error: Property access can throw but is not marked with 'try'
Utils.swift:97:32

And web3swift dependency errors:
Value of type 'RawSpan' has no member 'count'
Value of type 'RawSpan' has no subscripts

Changes

  1. Updated web3swift Dependency (Package.swift)

// Before:
.package(url: "...", .upToNextMajor(from: "3.2.2"))

// After:
.package(url: "...", .upToNextMajor(from: "3.2.2")) // Allows 3.3.x

  1. Added try to Throwing Property Access (Utils.swift:97)

// Before:
let rawClientData = webauthn.clientDataJSON.bytes

// After:
let rawClientData = try webauthn.clientDataJSON.bytes

Swift 6 enforces stricter error handling and recognizes .bytes as a throwing accessor.

  1. Added try? to Contract Method Call (Utils.swift)

// Before:
let callData = contract.method(functionName, parameters: args, extraData: nil)

// After:
let callData = try? contract.method(functionName, parameters: args, extraData: nil)

Testing

  • ✅ Builds successfully on Xcode 16 with Swift 6
  • ✅ Tested on Codemagic CI (mac_mini_m1)
  • ✅ iOS app runs correctly with passkey wallet features
  • ✅ Wallet creation, login, and transaction signing all functional
  • ✅ Deployed and tested on physical iOS device

Related Issues

Fixes #25

Checklist

  • Code compiles without errors on Swift 6
  • No breaking changes to public API
  • Backwards compatible with Swift 5.x
  • Tested on real device

Requested Reviewers: @romac @cason @MasterXen @rdragos @christophercampbell

superbigroach and others added 3 commits November 30, 2025 21:34
The method call can throw but was not marked with 'try'.
This fixes the build error on Xcode with Swift 6:
'Property access can throw but is not marked with try'
Utils.swift:97 - clientDataJSON.bytes is a throwing property in Swift 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant