Skip to content

Instantly share code, notes, and snippets.

View samrshi's full-sized avatar

Sam Shi samrshi

View GitHub Profile
@samrshi
samrshi / ContentView.swift
Created July 1, 2022 05:38
SwiftUI - Snapshot the view inside a UIViewRepresentable (barely) using Combine
import SwiftUI
import Combine
struct ContentView: View {
@State private var text = "A\nB\nC\nD\nE\nF\nG\nH"
@State private var image: Image?
private let snapshotRequester = PassthroughSubject<Void, Never>()
var body: some View {