SharingPanel Parentcontrol

What would be an example for the 3rd parameter on the Sharing Panel, I can’t seem to satisfy the syntax as it keeps asking for a MobileUIControl but rejects what I add unless I pick a random button control.

SharingPanel1.SharePicture(MyPicture, self, Parameter example )

Set it to a button or something. It’s only used for ipad. Maybe you can set it to a mobiletoolbarbutton?

MySharingPanel.SharePicture(myPic, Self, Me)

1 Like

Thanks @DerkJ that’s what I have been doing but wanted some understanding of the parameter instead of just making it work.

I see, now as you are not the only one. Let bring in @Paul_Lefebvre and see if he knows what the last parameter is about.

I don’t have anything more to add than wha the doc page says. parentControl is

The parent control from which a popover appears when the sharing panel is displayed on an iPad. Cannot be Nil.

I’m not sure what you mean by

it keeps asking for a MobileUIControl but rejects what I add unless I pick a random button control

Do you get a compile error? Runtime error? If so, what is it?

Hi @Paul_Lefebvre, no errors. I just assign the 3rd parameter to a random button on the screen and it seems to run ok but doesn’t make any sense as to why I would do that?

On an iPad the pop up will display originating from that control you specify instead of the bottom of the screen like on a phone.

1 Like

Is SharingPanel expected to appear in Simulator?
Doesnt work for me…

Are you logged in on the simulator?

In what way ‘logged in’?
I havent been asked to sign into icloud or similar, if that what you mean.
I can see that may be important. I’ll see if I can find a way to do it that doesnt make the whole mac/apple/user/icloud thing have a fit.

EDIT: Logged in, no change.

My code:

theshare.Name = filename
xmlstr = Myxml.ToString
theshare.ShareText (xmlstr, thedesigner, thedesigner.maingrid)

In your apple account on the simulator. Perhaps there is no way to share without?

Yeah. Logged into my apple account, but nothing.

Annoyingly , both iOSSharingPanel and MobileSharingPanel insist on a Text first parameter, although my strings are String.
(Xojo 2020 R2)
Mobile can take 1 parameter, IOSSharing demands 3 , of which 2 need to be IOS controls and views, where all my screens and controls are the Mobile versions.
Not consistent yet.

1 Like