I wrapped up all my goodies on working with UIKit, including generic subclasses of UIDocumentBrowserViewController in https://github.com/benspratling4/WorkableUIKit
In particular, look GenericDocumentBrowserViewController.swift and GenericDocumentSceneDelegate.swift
If there's a bug or a missing feature, let me know. I plan on shipping an app with this the second monterey is out of beta.