Taking Lossless Picture

I am following these directions to code picture taking:

https://www.appcoda.com/avfoundation-swift-guide/

These directions are for taking jpeg shots. But what is needed is to output to a lossless format such as DNG, PNG, or BMP.

How would those instructions be modified to output pictures in a lossless format?

Is there a tutorial similar to the one linked to above that explains how to do lossless formats?

Hello, I recommend that you take a look at Capturing Photos in RAW and Apple ProRAW Formats.

Taking Lossless Picture
 
 
Q