Xcode Previews is part of iOS, though not normally shown. Whether its appearance here is due to an iOS bug, due to some other innocuous activity, or due to unauthorized activity, is unclear.
However… If your iPhone has been accessed without authorization, and if your Wi-Fi router has been accessed without authorization, and/or if your Apple ID password is possibly become known to others, your security will be best served by addressing those (far larger) issues first.
Reset and reload the iPhone, and reset the router (first), and check for and update the firmware for, and then reconfigure the Wi-Fi router, as a starting point.
Use new and unique and robust passwords. Particularly for your Apple ID, for your cellular provider account PIN, and the passwords for any password-reset paths such as (usually) your main mail email accounts.
Enable two-factor authentication on your Apple ID too, if that is not already enabled.
Here is some additional reading: https://manuals.info.apple.com/MANUALS/1000/MA1976/en_US/device-and-data-access-when-personal-safety-is-at-risk.pdf