I recently worked on a project where I had to access the depth data on an iPhone X. I forked the ALCameraViewController project and created a
depth branch. You can clone my repository and checkout the depth branch. Then run the demo app and take a picture with the camera.
Put a breakpoint on line 148 of the CameraView.swift file and check if
photo.depthData is nil in the
photoOutput(_, didFinishProcessingPhoto, error) callback. For me it was never nil on an iPhone X.
If it's not nil then you can compare the code and understand the difference. It it's nil then it's probably a bug in iOS itself and I'd suggest you to update to the latest iOS version.