Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Use VZVirtualMachineView with actor-isolated VZVirtualMachine

We are using VZVirtualMachine instances in a Swift actor. It works fine but we hit a major problem when we decided that we want to attach it to a VZVirtualMachineView to show it / allow user interactions.

VZVirtualMachineView and its virtualMachine property is isolated to @MainActor, so if we directly assign our vm instance to it, we receive a concurrency error:

@MainActor
public func createView() -> VZVirtualMachineView {
  let view = VZVirtualMachineView()
  view.virtualMachine = vm  // x: Actor-isolated property 'vm' can not be referenced from the main actor

  return view
}

Is there any way we can make this work?

Are you working with the publicly released Xcode 16.4? Or the recently seeded Xcode 26.0 beta?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Use VZVirtualMachineView with actor-isolated VZVirtualMachine
 
 
Q