OctoBase icon indicating copy to clipboard operation
OctoBase copied to clipboard

Swift Demo not compiled

Open videni opened this issue 9 months ago • 2 comments

Hi, how do you guys fix this the error please? I am using the latest code from the master.

apps/swift/octobase-demo/octobase_demoApp.swift#L26C1-L27C1

class JwstWorkspace: ObservableObject {
    var workspace: Workspace
    
    init (workspace: String) {
      // Not compiled ,  even changing it to Workspace(ptr: workspace.intoRustString())
        self.workspace = Workspace(workspace)
    }
}

Error

OctoBase/apps/swift/octobase-demo/octobase_demoApp.swift:26:36 Cannot convert value of type 'String' to expected argument type 'UnsafeMutableRawPointer'

videni avatar Mar 02 '25 13:03 videni

Hello! Thank you for filing an issue. If this is a bug report, please include relevant logs to help us debug the problem.

affine-bot avatar Mar 02 '25 13:03 affine-bot

Must add following to Workspace ffi.

   extern "Rust" {
        type Workspace;

        #[swift_bridge(init)]
        fn new(id: String) -> Workspace;
}

videni avatar Mar 02 '25 13:03 videni