Relative Content

Tag Archive for swiftswiftuiprintinguiactivityviewcontroller

UIactivityController not displaying printing image first time in swiftui

In swiftui app taking snapshot of view with images and text.Then on one button saving it in gallery and other button dislaying share sheet with uiactivitycontroller. Image is not displaying first time and sheet is blank. working fine after second time. in takescreenshot method screenshot is there but in sheet method screenshot image is not there. Please help
struct ShareImageView: View {
@State var shouldHideHeaderBack: Bool = false
@AppStorage(“username”) var userName: String?
@State var selectImageByUser: UIImage?
@State private var showingShareSheet = false
@State private var snapshotImage: UIImage?
@State private var isSnapshotReady = false // Track if snapshot is ready