iOS Sharing Panel
From Xojo Documentation
Contents
The Sharing Panel allows the app to share text, a URL, or a picture with any registered iOS system service or app.
This control does not have UI that displays on the layout so it appears in the Shelf when dragged to the layout.
Below is a list of commonly used events, properties and methods. Refer to iOSSharingPanel in the Language Reference for details on its events and methods.
Events
- Called if the user cancels the sharing operation.
- Called when the sharing operation is completed.
Methods
- Shares a picture. You need to provide the picture, the parent view and parent control.
- Shares text. You need to provide the text, the parent view and parent control.
- Share a URL. You need to provide the URL, the parent view and parent control.
Usage
This code on a button's Action event handler shares text:
Starting with iOS 11, if you use the SharePicture method your app's Info.plist will need to include an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data. For example:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>NSPhotoLibraryAddUsageDescription</key> <string>Allow photos to be added to the photo library.</string> </dict> </plist>
Example Projects
- Examples/iOS/Controls/SharingPanel
See Also
iOSSharingPanel class; UserGuide:iOS UI topic