A lot of apps just produce a black screen image (sometimes with a logo) when you screenshot within them. It appears the UITextField trick most had used no longer works in iOS 18. How can you achieve this?
There's no supported way for you to prevent screen captures with the public APIs currently available. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.
If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?