Guard compilation of all DebugUI* classes with USE_DEBUG_UI instead of DEBUG and stop defining USE_DEBUG_UI whenever DEBUG is defined. Instead I defined USE_DEBUG_UI separately for Debug builds in the project settings. Benefits: • can easily enable Debug UI for non-debug builds. • allow use USE_DEBUG_UI in Swift files.
50 lines
1.6 KiB
Objective-C
50 lines
1.6 KiB
Objective-C
//
|
|
// Copyright 2017 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
//
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@class TSAttachmentStream;
|
|
|
|
typedef void (^AttachmentSharingCompletion)(void);
|
|
|
|
@interface AttachmentSharing : NSObject
|
|
|
|
+ (void)showShareUIForAttachment:(TSAttachmentStream *)stream sender:(nullable id)sender;
|
|
+ (void)showShareUIForAttachments:(NSArray<TSAttachmentStream *> *)attachments sender:(nullable id)sender;
|
|
|
|
+ (void)showShareUIForAttachment:(TSAttachmentStream *)stream
|
|
sender:(nullable id)sender
|
|
completion:(nullable AttachmentSharingCompletion)completion;
|
|
|
|
+ (void)showShareUIForAttachments:(NSArray<TSAttachmentStream *> *)attachments
|
|
sender:(nullable id)sender
|
|
completion:(nullable AttachmentSharingCompletion)completion;
|
|
|
|
+ (void)showShareUIForURL:(NSURL *)url sender:(nullable id)sender;
|
|
|
|
+ (void)showShareUIForURL:(NSURL *)url
|
|
sender:(nullable id)sender
|
|
completion:(nullable AttachmentSharingCompletion)completion;
|
|
|
|
+ (void)showShareUIForURLs:(NSArray<NSURL *> *)urls
|
|
sender:(nullable id)sender
|
|
completion:(nullable AttachmentSharingCompletion)completion;
|
|
|
|
+ (void)showShareUIForText:(NSString *)text sender:(nullable id)sender;
|
|
|
|
+ (void)showShareUIForText:(NSString *)text
|
|
sender:(nullable id)sender
|
|
completion:(nullable AttachmentSharingCompletion)completion;
|
|
|
|
#ifdef USE_DEBUG_UI
|
|
+ (void)showShareUIForUIImage:(UIImage *)image;
|
|
#endif
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|