iOS 13.0 and later
We are aware of an issue where VNC Viewer connections are closed whenever you switch applications. Our development team is actively investigating this.
Versions of iOS earlier than 13.0
This is related to a change in a recent version of iOS.
You need to ensure that Background App Refresh is enabled in iOS' Settings, in the General section. This will allow you to switch apps without being immediately disconnected.
N.B. due to an Apple limitation, the connection will still be closed after a couple of minutes when the VNC Viewer app is in the background.