How to set the world alignment to gravity and heading for Roomplan?

So in the WWDC23 video on the Roomplan enhancement, it says that it is now possible to set a custom ARSession for the RoomCaptureSession. But how do you actually set the config for the custom ARSession?

init() {
      let arConfig = ARWorldTrackingConfiguration()
      arConfig.worldAlignment = .gravityAndHeading
      arSession = ARSession()
      roomCaptureView = RoomCaptureView(frame: CGRect(x: 0, y: 0, width: 42, height: 42), arSession: arSession)
      sessionConfig = RoomCaptureSession.Configuration()
      roomCaptureView.captureSession.delegate = self
      roomCaptureView.delegate = self
  }

However, I keep getting an issue that self is being used in the property access before being initialised. What can I do to fix it?

How to set the world alignment to gravity and heading for Roomplan?
 
 
Q