+ Fixes ActionSheet madness

This commit is contained in:
moritz haarmann
2014-02-26 10:10:56 +01:00
parent 28eee0eb3d
commit 35dc6c58d5
3 changed files with 48 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
//
// BITArrowImageAnnotation.h
// HockeySDK
//
// Created by Moritz Haarmann on 26.02.14.
//
//
#import "BITImageAnnotation.h"
@interface BITArrowImageAnnotation : BITImageAnnotation
@end

View File

@@ -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

View File

@@ -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];