Accessing UIActivityViewController

I’m curious as to whether anyone has figured out how to access the iOS UIActivityViewController. It’s that sheet that pops up to facilitate sending text, files, etc to other apps on the device.

Hi Robert, I was actually going to look into this today after I finish implementing the UISearchBar. I’ll post my results in a few hours.

Wow … the UISearchbar ! Thats one I also need. :slight_smile:
Finger crossed if I can put the UISearchbar also in the nagivationbar. :slight_smile:

Jason,
Thanks for the effort. I’ve tried to do it myself but passing to iOS declares remains an undeveloped skill for me. For example, I can alloc a UIActivityViewController but can’t initialize it, apparently because I haven’t figured out how to pass arrays from Xojo. I’m anxious to learn something from your follow up. Thanks again.

Here you go. It’s pretty simple to use and should all be explained in the few comments in the example project.
https://www.dropbox.com/s/zz7vyjbn6r0y81g/UIActivityViewController.xojo_binary_project?dl=0

If you have any questions let me know.

A note: If you want to be able to create custom UIActivity objects let me know. I didn’t take the time to implement everything necessary to do so but easily can if desired.

Man! You’ve got that stuff down pat. Like many here, I really appreciate your help.

You’re welcome. I’m glad I could help.

Why can’t the “Like” button be pressed a couple hundred times? :slight_smile:

[quote=156477:@Jason King]Here you go. It’s pretty simple to use and should all be explained in the few comments in the example project.
https://www.dropbox.com/s/zz7vyjbn6r0y81g/UIActivityViewController.xojo_binary_project?dl=0

If you have any questions let me know.[/quote]

Thank you for sharing, Jason :slight_smile:

Please tell me the way to set UIActivityTypePrint to UIActivityViewController.excludedActivityTypes.

I’m not at my computer right now but it should be possible with

controller.excludedActivityTypes = NSArray.CreateWithObject( new NSString(UIActivity.UIActivityTypePrint))
That is of course untested and maybe the property is called something slightly differently but you get the idea.

Edit: Fixed code to use tested code which works.

Thank you Jason.

You’re welcome.

Jason Thank you always.

How to set a multiple of Item in excludedActivityTypes ?

[quote=156907:@Hironobu Sekine]Jason Thank you always.

How to set a multiple of Item in excludedActivityTypes ?[/quote]
You just need to create an array of the NSStrings and pass that to the NSArray.CreateWithObjects method. Like this:

controller.excludedActivityTypes = NSArray.CreateWithObjects( Array(new NSString(UIActivity.UIActivityTypePrint), new NSString(UIActivity.UIActivityTypePodtToFacebook), ETC))

Many thanks.

You’re welcome.

How can I share a link or simple text or text and picture, like on Mac OS X?

Take a look at the ActivityView in the examples of iOSKit. It shows exactly how to do this.