Issue in a function in Photowidget.

Hello,

I am trying to make a func in a Photowidget of indent configuration that can select photo from the user library as a timeline entry.

But, it is showing error for doing that.

Here, I am attaching the screenshot for that code.

Please can you guys help me for to solve that issue.

Thanks, Jayesh Patel.

    

struct ReInventingMemoriesView : View 

{    

    @State var Photo: UIImage?

    let configuration: ReInventingMemoriesIntent

    var iCloudPhotosEnabled:Bool

    var entry: Provider.Entry

    let intent = ReInventingMemoriesIntent()

    let kind: String = "ReInventingMemories"

     var body: some View {

        func SelectPhoto()  {

             if (Photo != nil || iCloudPhotosEnabled = .true) {

                ForEach(Photo.PHPhotoLibrary, id:\.self) { Photo  in

                    INSearchForPhotosIntentIdentifier.random(count(1))

               }

                     }

                  .clipShape(RoundedRectangle(cornerRadius: 20))

                    .scaleEffect(WidgetSize.scaleFactor)

                    .stroke(lineWidth: 2)

                    .shadow(radius: 5)

                    .overlay {

                        if true {

                            Image(systemName: "My Memories")

                        }

                    }

            }

            

        }

        

    }

    

Issue in a function in Photowidget.
 
 
Q