Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 442 Bytes

File metadata and controls

27 lines (19 loc) · 442 Bytes

ScreenshotableView

Screenshotable view for SwiftUI

How to use?

@State private var sharedImage: UIImage?
@State private var shotting = false

...

// The view want to take screenshot
var content: some View {
...
}

ScreenshotableView(shotting: self.$shotting,
                   completed: { screenshot in
                   self.sharedImage = screenshot
                   self.shotting = false
}) {
    self.content
}