[iOS] How do I get a screenshot when my app working background in swift?

While the application is running in the background, I need to take a screenshot and save it in the photos folder. When I try with my test app, it takes only the front of the application. How can I take a screenshot in the background?

[iOS] How do I get a screenshot when my app working background in swift?
 
 
Q