On first click the share sheet shows nothing

I am developing an application as a project for training. This is a meme sharing application. I use .sheet in order to present a modal view to share meme given as an image :

.sheet(isPresented: $showingSharePage) {
            ShareSheet(items: items)
        }

Here is my code for the share sheet :

struct ShareSheet: UIViewControllerRepresentable {
    var items: [Any]
    
    func makeUIViewController(context: Context) -> UIActivityViewController {
        let controller = UIActivityViewController(activityItems: items, applicationActivities: nil)
        return controller
    }
    
    func updateUIViewController(_ uiViewController: UIActivityViewController, context: Context) {
        
    }
}

Here is my share button's code :

ToolbarItemGroup {
                    AnimatedActionButton(title: "Share", systemImage: "square.and.arrow.up") {
                        items.removeAll()
                        let snapshot = meme.snapshot()
                        items.append(snapshot)
                        showingSharePage = true
                    }
                }

The problem is that when I open for the first time (when application is launched), it doesn't show anything :

After after launching once, it works alright.

Why is it doing this ?

P.S : For further information, I share the whole GitHub project (this is a project for a course from Udacity) : https://github.com/m4thus4n/Project

You should better show the whole code of the core files causing the issue. Or at least you should show in which file each code block of yours exists. Not all readers have enough time to explore files in a GitHub repository.

I did what you said ! The github project folder is to reproduce the bug. You can not See it !

@mathusan When you post an image, could you first reduce it in Preview app (Tools > Adapt size) ? Otherwise it appears uselessly large on the forum. And please show the essential code directly here.

On first click the share sheet shows nothing
 
 
Q