mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 02:22:44 +02:00
Added comments describing ShareExtensionManager public functionality + small method renaming
This commit is contained in:
@@ -19,34 +19,71 @@
|
||||
|
||||
@class ShareExtensionManager;
|
||||
|
||||
/**
|
||||
The protocol for the manager's delegate
|
||||
*/
|
||||
@protocol ShareExtensionManagerDelegate <NSObject>
|
||||
|
||||
@required
|
||||
|
||||
/**
|
||||
Called when an image is going to be shared to show a compression prompt
|
||||
@param extensionManager the ShareExtensionManager object that called the method
|
||||
@param compressionPrompt the prompt that was prepared for the image which is going to be shared
|
||||
*/
|
||||
- (void)shareExtensionManager:(ShareExtensionManager *)extensionManager showImageCompressionPrompt:(UIAlertController *)compressionPrompt;
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
Called when the progress of the uploading media changes
|
||||
@param extensionManager the ShareExtensionManager object that called the method
|
||||
@param progress the current progress
|
||||
*/
|
||||
- (void)shareExtensionManager:(ShareExtensionManager *)extensionManager mediaUploadProgress:(CGFloat)progress;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
A class used to share content from the extension
|
||||
*/
|
||||
|
||||
@interface ShareExtensionManager : NSObject
|
||||
|
||||
/**
|
||||
The share extension context that represents a user's sharing request, also stores the content to be shared
|
||||
*/
|
||||
@property (nonatomic) NSExtensionContext *shareExtensionContext;
|
||||
|
||||
/**
|
||||
A delegate used to notify about needed UI changes when sharing
|
||||
*/
|
||||
@property (nonatomic) id<ShareExtensionManagerDelegate> delegate;
|
||||
|
||||
/**
|
||||
The singleton instance
|
||||
*/
|
||||
+ (instancetype)sharedManager;
|
||||
|
||||
/**
|
||||
Send the content that the user has chosen to a room
|
||||
@param room the room to send the content to
|
||||
@param failureBlock the code to be executed when sharing has failed for whatever reason
|
||||
note: there is no "successBlock" parameter because when the sharing succeds, the extension needs to close itself
|
||||
*/
|
||||
- (void)sendContentToRoom:(MXRoom *)room failureBlock:(void(^)())failureBlock;
|
||||
|
||||
/**
|
||||
Checks if there is an image in the user chosen content
|
||||
@return YES if there is, NO otherwise
|
||||
*/
|
||||
- (BOOL)hasImageTypeContent;
|
||||
|
||||
- (void)cancelSharing;
|
||||
|
||||
- (void)cancelSharingWithFailure;
|
||||
|
||||
- (UIAlertController *)compressionPromptForImage:(UIImage *)image shareBlock:(nonnull void(^)())shareBlock;
|
||||
/**
|
||||
Terminate the extension and return to the app that started it
|
||||
@param canceled YES if the user chose to cancel the sharing, NO otherwise
|
||||
*/
|
||||
- (void)terminateExtensionCanceled:(BOOL)canceled;
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user