Encapsulated all the snapshot logic into a view extension and a single update check. To implement snapshotting, a view now just needs to
have an @ObservedObject var snapshotModel: SnapshotExportModel
attach to the view .snapshotMenus(for: _snapshotModel)
include in the view snapshotModel.promptButton(scan: scan) wherever the button should be included
in the render controller update method call snapshotModel.viewUpdaterHandler(scnView: uiView, overlay: X) with an optional overlay SKScene.
When the prompt button is clicked, an action sheet appears with scaling options:
Once a scale is chosen, the viewUpdateHandler triggers a PNG render of the given scene (with optional overlay) scaled with the selected multiplier, then opens the PNG in a share sheet.
Encapsulated all the snapshot logic into a view extension and a single update check. To implement snapshotting, a view now just needs to
@ObservedObject var snapshotModel: SnapshotExportModel
.snapshotMenus(for: _snapshotModel)
snapshotModel.promptButton(scan: scan)
wherever the button should be includedsnapshotModel.viewUpdaterHandler(scnView: uiView, overlay: X)
with an optional overlay SKScene.When the prompt button is clicked, an action sheet appears with scaling options:
Once a scale is chosen, the
viewUpdateHandler
triggers a PNG render of the given scene (with optional overlay) scaled with the selected multiplier, then opens the PNG in a share sheet.