LeoNatan/LNPopupUI

PlayerView question

Closed this issue · 3 comments

Hi @LeoNatan ,

I am trying to replace this:

     .popupImage(Image(song.imageName).resizable())

by:

     let image = Image(song.imageName).resizable()
     .popupImage(image)

to use the same image reference elsewhere.

I get the following error:

Variable used within its own initial value

What am i doing wrong, please?

Thanks,

Hello,

Not sure what you are attempting to do?
From the code you posted, you are indeed using image while initialing it. I think you are misunderstanding what .popupImage() actually does. It's a modifier over the View protocol, setting a preference.

func popupImage(_ image: Image) -> some View {

Pfff, it is an error, I made a mistake.

What I'm trying to do is get the frame of the player image (the popup content) to provide it to the popup controller which would use it while opening the popup ...

You can provide a frame, but the image on the popup bar is constant size.