1

I am currently working on the photobooth app. My friend and I have a dispute over which tech stack we should use to generate the ready-to-print image that is generated out of the frame and some pictures taken by the camera, added into the blank spaces.

I went with some CoreGraphics fundamentals and created a bitmap-based graphic. Can you recommend if that can be done better? My friend advises using the GeometryReader but it seems to me as overkill for that case.

What do you think? Can it be done better? Here is the method:

    func createStrip() -> UIImage? {
        let stripSize = CGSize(width: template.image.size.width, height: template.image.size.height)
        
        UIGraphicsBeginImageContextWithOptions(stripSize, false, template.image.scale)
        
        photos.enumerated().forEach { index, photo in
            photo.draw(in: template.blanks[index].rect)
        }
        template.image.draw(in: CGRect(origin: CGPoint(x: 0, y: 0), size: template.image.size))

        return UIGraphicsGetImageFromCurrentImageContext()
    }

Thanks!

Jakub Gawecki
  • 801
  • 2
  • 6
  • 14

0 Answers0