Any way to change the UI for browse previous versions?

My UI is very heavyweight, so I'd like to show the previous versions using a lighter weight - almost like quick look - UI.

This would also allow me to 'zoom to fit' so the entire document can be seen.

I am using SwiftUI, but I wouldn't mind jumping into AppKit and/or UIKit to implement this.

Answered by robaho in 828325022

The ScenePhase only seems to update on the last document opened, so it doesn't work properly.

The only way I could make this work was by checking if the url passed in contains "com.apple.documentVersions".

Kind of a hack, but it is the only thing that seemed to work reliably.

Hopefully someone else has a better solution.

Not sure if this is correct, but the browse previous versions has the scene phase as background, and I can inspect this and create an alternate UI.

Accepted Answer

The ScenePhase only seems to update on the last document opened, so it doesn't work properly.

The only way I could make this work was by checking if the url passed in contains "com.apple.documentVersions".

Kind of a hack, but it is the only thing that seemed to work reliably.

Hopefully someone else has a better solution.

a SwiftUI FileDocument doesn't expose the 'isBrowsingVersions' so the previous answer was the best I could manage.

I had too many problems with SwiftUI DoucmentGroup that I needed to move to using a NSDocument based system.

Any way to change the UI for browse previous versions?
 
 
Q