State restoration for UIViewControllerRepresentable

I'm trying to implement state restoration for my app which includes UIKit and SwiftUI codes.

My SwiftUI Views could be preserved while entering background and restored after app start, but the UIViewControllerRepresentable view inside SwiftUI View can only be initialized but not preserved and restored through UIViewController's encodeRestorableState(with:) and decodeRestorableState(with:).

Is there any way to make it work? Thanks for any help~

State restoration for UIViewControllerRepresentable
 
 
Q