Add Debug UI around sharing UIImage.

pull/1/head
Matthew Chen 8 years ago
parent 0c6639cf52
commit 79ee6fa318

@ -12,7 +12,9 @@
#import "ThreadUtil.h" #import "ThreadUtil.h"
#import <AFNetworking/AFNetworking.h> #import <AFNetworking/AFNetworking.h>
#import <AxolotlKit/PreKeyBundle.h> #import <AxolotlKit/PreKeyBundle.h>
#import <SignalMessaging/AttachmentSharing.h>
#import <SignalMessaging/Environment.h> #import <SignalMessaging/Environment.h>
#import <SignalMessaging/UIImage+OWS.h>
#import <SignalServiceKit/OWSDisappearingConfigurationUpdateInfoMessage.h> #import <SignalServiceKit/OWSDisappearingConfigurationUpdateInfoMessage.h>
#import <SignalServiceKit/OWSDisappearingMessagesConfiguration.h> #import <SignalServiceKit/OWSDisappearingMessagesConfiguration.h>
#import <SignalServiceKit/OWSVerificationStateChangeMessage.h> #import <SignalServiceKit/OWSVerificationStateChangeMessage.h>
@ -95,15 +97,24 @@ NS_ASSUME_NONNULL_BEGIN
[DebugUIMisc sendUnencryptedDatabase:thread]; [DebugUIMisc sendUnencryptedDatabase:thread];
}]]; }]];
} }
[items addObject:[OWSTableItem [items addObject:[OWSTableItem subPageItemWithText:@"Export Backup w/o Password"
subPageItemWithText:@"Export Backup w/o Password" actionBlock:^(UIViewController *viewController) {
actionBlock:^(UIViewController *viewController) { OWSBackupExportViewController *backupViewController =
OWSBackupExportViewController *backupViewController = [OWSBackupExportViewController new];
[OWSBackupExportViewController new]; [backupViewController exportBackup:thread skipPassword:YES];
[backupViewController exportBackup:thread skipPassword:YES]; [viewController.navigationController
[viewController.navigationController pushViewController:backupViewController pushViewController:backupViewController
animated:YES]; animated:YES];
}]]; }]];
#ifdef DEBUG
[items addObject:[OWSTableItem subPageItemWithText:@"Share UIImage"
actionBlock:^(UIViewController *viewController) {
UIImage *image =
[UIImage imageWithColor:UIColor.redColor size:CGSizeMake(1.f, 1.f)];
[AttachmentSharing showShareUIForUIImage:image];
}]];
#endif
return [OWSTableSection sectionWithTitle:self.name items:items]; return [OWSTableSection sectionWithTitle:self.name items:items];
} }

@ -1,5 +1,5 @@
// //
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// //
@class TSAttachmentStream; @class TSAttachmentStream;
@ -12,4 +12,8 @@
+ (void)showShareUIForText:(NSString *)text; + (void)showShareUIForText:(NSString *)text;
#ifdef DEBUG
+ (void)showShareUIForUIImage:(UIImage *)image;
#endif
@end @end

@ -1,5 +1,5 @@
// //
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// //
#import "AttachmentSharing.h" #import "AttachmentSharing.h"
@ -35,6 +35,17 @@
]]; ]];
} }
#ifdef DEBUG
+ (void)showShareUIForUIImage:(UIImage *)image
{
OWSAssert(image);
[AttachmentSharing showShareUIForActivityItems:@[
image,
]];
}
#endif
+ (void)showShareUIForActivityItems:(NSArray *)activityItems + (void)showShareUIForActivityItems:(NSArray *)activityItems
{ {
OWSAssert(activityItems); OWSAssert(activityItems);

Loading…
Cancel
Save