From 35dc6c58d523144d016319b259d24c083371a357 Mon Sep 17 00:00:00 2001 From: moritz haarmann Date: Wed, 26 Feb 2014 10:10:56 +0100 Subject: [PATCH] + Fixes ActionSheet madness --- Classes/BITArrowImageAnnotation.h | 13 +++++++++ Classes/BITArrowImageAnnotation.m | 31 ++++++++++++++++++++++ Classes/BITFeedbackComposeViewController.m | 8 +++--- 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 Classes/BITArrowImageAnnotation.h create mode 100644 Classes/BITArrowImageAnnotation.m diff --git a/Classes/BITArrowImageAnnotation.h b/Classes/BITArrowImageAnnotation.h new file mode 100644 index 0000000000..ff243af6a4 --- /dev/null +++ b/Classes/BITArrowImageAnnotation.h @@ -0,0 +1,13 @@ +// +// BITArrowImageAnnotation.h +// HockeySDK +// +// Created by Moritz Haarmann on 26.02.14. +// +// + +#import "BITImageAnnotation.h" + +@interface BITArrowImageAnnotation : BITImageAnnotation + +@end diff --git a/Classes/BITArrowImageAnnotation.m b/Classes/BITArrowImageAnnotation.m new file mode 100644 index 0000000000..d215bdb7a5 --- /dev/null +++ b/Classes/BITArrowImageAnnotation.m @@ -0,0 +1,31 @@ +// +// BITArrowImageAnnotation.m +// HockeySDK +// +// Created by Moritz Haarmann on 26.02.14. +// +// + +#import "BITArrowImageAnnotation.h" + +@implementation BITArrowImageAnnotation + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + } + return self; +} + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + // Drawing code +} +*/ + +@end diff --git a/Classes/BITFeedbackComposeViewController.m b/Classes/BITFeedbackComposeViewController.m index ac687dc263..c2806e0dcb 100644 --- a/Classes/BITFeedbackComposeViewController.m +++ b/Classes/BITFeedbackComposeViewController.m @@ -421,8 +421,8 @@ self.selectedAttachmentIndex = index; UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle: nil delegate: self - cancelButtonTitle: @"Delete Attachment" - destructiveButtonTitle: nil + cancelButtonTitle:@"Cancel" + destructiveButtonTitle: @"Delete Attachment" otherButtonTitles: @"Edit Attachment", nil]; [actionSheet showFromRect: sender.frame inView: self.attachmentScrollView animated: YES]; @@ -464,7 +464,7 @@ #pragma mark - UIActionSheet Delegate - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex { - if (buttonIndex == [actionSheet cancelButtonIndex]){ + if (buttonIndex == [actionSheet destructiveButtonIndex]){ if (self.selectedAttachmentIndex != NSNotFound){ BITFeedbackMessageAttachment* attachment = [self.attachments objectAtIndex:self.selectedAttachmentIndex]; @@ -474,7 +474,7 @@ self.selectedAttachmentIndex = NSNotFound; [self refreshAttachmentScrollview]; - } else { + } else if(buttonIndex != [actionSheet cancelButtonIndex]){ if (self.selectedAttachmentIndex != NSNotFound){ BITFeedbackMessageAttachment* attachment = [self.attachments objectAtIndex:self.selectedAttachmentIndex]; BITImageAnnotationViewController *annotationEditor = [[BITImageAnnotationViewController alloc ] init];