diff --git a/Classes/BITFeedbackActivity.m b/Classes/BITFeedbackActivity.m index a5876801a5..75fe13ba88 100644 --- a/Classes/BITFeedbackActivity.m +++ b/Classes/BITFeedbackActivity.m @@ -59,7 +59,7 @@ _customActivityImage = nil; _customActivityTitle = nil; - self.items = [NSMutableArray array];; + _items = [NSMutableArray array]; } return self; diff --git a/Classes/BITFeedbackComposeViewController.m b/Classes/BITFeedbackComposeViewController.m index 9314cb0546..e9885e5df1 100644 --- a/Classes/BITFeedbackComposeViewController.m +++ b/Classes/BITFeedbackComposeViewController.m @@ -79,7 +79,6 @@ - (instancetype)init { self = [super init]; if (self) { - self.title = BITHockeyLocalizedString(@"HockeyFeedbackComposeTitle"); _blockUserDataScreen = NO; _actionSheetVisible = NO; _delegate = nil; @@ -87,8 +86,8 @@ _attachments = [NSMutableArray new]; _imageAttachments = [NSMutableArray new]; _attachmentScrollViewImageViews = [NSMutableArray new]; - self.tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scrollViewTapped:)]; - [self.attachmentScrollView addGestureRecognizer:self.tapRecognizer]; + _tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scrollViewTapped:)]; + [_attachmentScrollView addGestureRecognizer:self.tapRecognizer]; _text = nil; } @@ -167,6 +166,7 @@ - (void)viewDidLoad { [super viewDidLoad]; + self.title = BITHockeyLocalizedString(@"HockeyFeedbackComposeTitle"); self.view.backgroundColor = [UIColor whiteColor]; // Do any additional setup after loading the view. diff --git a/Classes/BITFeedbackListViewCell.m b/Classes/BITFeedbackListViewCell.m index 9b0c1de184..2e9519a01a 100644 --- a/Classes/BITFeedbackListViewCell.m +++ b/Classes/BITFeedbackListViewCell.m @@ -85,28 +85,28 @@ _message = nil; - self.dateFormatter = [[NSDateFormatter alloc] init]; - [self.dateFormatter setTimeStyle:NSDateFormatterNoStyle]; - [self.dateFormatter setDateStyle:NSDateFormatterMediumStyle]; - [self.dateFormatter setLocale:[NSLocale currentLocale]]; - [self.dateFormatter setDoesRelativeDateFormatting:YES]; + _dateFormatter = [[NSDateFormatter alloc] init]; + [_dateFormatter setTimeStyle:NSDateFormatterNoStyle]; + [_dateFormatter setDateStyle:NSDateFormatterMediumStyle]; + [_dateFormatter setLocale:[NSLocale currentLocale]]; + [_dateFormatter setDoesRelativeDateFormatting:YES]; - self.timeFormatter = [[NSDateFormatter alloc] init]; - [self.timeFormatter setTimeStyle:NSDateFormatterShortStyle]; - [self.timeFormatter setDateStyle:NSDateFormatterNoStyle]; - [self.timeFormatter setLocale:[NSLocale currentLocale]]; - [self.timeFormatter setDoesRelativeDateFormatting:YES]; + _timeFormatter = [[NSDateFormatter alloc] init]; + [_timeFormatter setTimeStyle:NSDateFormatterShortStyle]; + [_timeFormatter setDateStyle:NSDateFormatterNoStyle]; + [_timeFormatter setLocale:[NSLocale currentLocale]]; + [_timeFormatter setDoesRelativeDateFormatting:YES]; - self.labelTitle = [[UILabel alloc] init]; - self.labelTitle.font = [UIFont systemFontOfSize:TITLE_FONTSIZE]; + _labelTitle = [[UILabel alloc] init]; + _labelTitle.font = [UIFont systemFontOfSize:TITLE_FONTSIZE]; - self.labelText = [[BITAttributedLabel alloc] init]; - self.labelText.font = [UIFont systemFontOfSize:TEXT_FONTSIZE]; - self.labelText.numberOfLines = 0; - self.labelText.textAlignment = kBITTextLabelAlignmentLeft; - self.labelText.dataDetectorTypes = UIDataDetectorTypeAll; + _labelText = [[BITAttributedLabel alloc] init]; + _labelText.font = [UIFont systemFontOfSize:TEXT_FONTSIZE]; + _labelText.numberOfLines = 0; + _labelText.textAlignment = kBITTextLabelAlignmentLeft; + _labelText.dataDetectorTypes = UIDataDetectorTypeAll; - self.attachmentViews = [NSMutableArray new]; + _attachmentViews = [NSMutableArray new]; } return self; } diff --git a/Classes/BITFeedbackListViewController.m b/Classes/BITFeedbackListViewController.m index 9397bf856a..9bf4bd2fb4 100644 --- a/Classes/BITFeedbackListViewController.m +++ b/Classes/BITFeedbackListViewController.m @@ -91,10 +91,10 @@ _userButtonSection = -1; _userDataComposeFlow = NO; - self.lastUpdateDateFormatter = [[NSDateFormatter alloc] init]; - [self.lastUpdateDateFormatter setDateStyle:NSDateFormatterShortStyle]; - [self.lastUpdateDateFormatter setTimeStyle:NSDateFormatterShortStyle]; - self.lastUpdateDateFormatter.locale = [NSLocale currentLocale]; + _lastUpdateDateFormatter = [[NSDateFormatter alloc] init]; + [_lastUpdateDateFormatter setDateStyle:NSDateFormatterShortStyle]; + [_lastUpdateDateFormatter setTimeStyle:NSDateFormatterShortStyle]; + _lastUpdateDateFormatter.locale = [NSLocale currentLocale]; _thumbnailQueue = [NSOperationQueue new]; } diff --git a/Classes/BITFeedbackManager.m b/Classes/BITFeedbackManager.m index a5043c1bab..cc2f962654 100644 --- a/Classes/BITFeedbackManager.m +++ b/Classes/BITFeedbackManager.m @@ -95,7 +95,7 @@ _token = nil; _lastMessageID = nil; - self.feedbackList = [NSMutableArray array]; + _feedbackList = [NSMutableArray array]; _fileManager = [[NSFileManager alloc] init]; @@ -537,7 +537,7 @@ __block BITFeedbackMessage *message = nil; [_feedbackList enumerateObjectsUsingBlock:^(BITFeedbackMessage *objMessage, NSUInteger messagesIdx, BOOL *stop) { - if ([[objMessage id] isEqualToNumber:messageID]) { + if ([[objMessage identifier] isEqualToNumber:messageID]) { message = objMessage; *stop = YES; } @@ -562,7 +562,7 @@ __block BITFeedbackMessage *message = nil; [_feedbackList enumerateObjectsUsingBlock:^(BITFeedbackMessage *objMessage, NSUInteger messagesIdx, BOOL *stop) { - if ([[objMessage id] integerValue] != 0) { + if ([[objMessage identifier] integerValue] != 0) { message = objMessage; *stop = YES; } @@ -590,8 +590,8 @@ - (void)updateLastMessageID { BITFeedbackMessage *lastMessageHavingID = [self lastMessageHavingID]; if (lastMessageHavingID) { - if (!self.lastMessageID || [self.lastMessageID compare:[lastMessageHavingID id]] != NSOrderedSame) - self.lastMessageID = [lastMessageHavingID id]; + if (!self.lastMessageID || [self.lastMessageID compare:[lastMessageHavingID identifier]] != NSOrderedSame) + self.lastMessageID = [lastMessageHavingID identifier]; } } @@ -723,13 +723,13 @@ if (matchingSendInProgressOrInConflictMessage) { matchingSendInProgressOrInConflictMessage.date = [self parseRFC3339Date:[(NSDictionary *)objMessage objectForKey:@"created_at"]]; - matchingSendInProgressOrInConflictMessage.id = messageID; + matchingSendInProgressOrInConflictMessage.identifier = messageID; matchingSendInProgressOrInConflictMessage.status = BITFeedbackMessageStatusRead; NSArray *feedbackAttachments =[(NSDictionary *)objMessage objectForKey:@"attachments"]; if (matchingSendInProgressOrInConflictMessage.attachments.count == feedbackAttachments.count) { int attachmentIndex = 0; for (BITFeedbackMessageAttachment* attachment in matchingSendInProgressOrInConflictMessage.attachments){ - attachment.id =feedbackAttachments[attachmentIndex][@"id"]; + attachment.identifier =feedbackAttachments[attachmentIndex][@"id"]; attachmentIndex++; } } @@ -741,13 +741,13 @@ message.email = [(NSDictionary *)objMessage objectForKey:@"email"] ?: @""; message.date = [self parseRFC3339Date:[(NSDictionary *)objMessage objectForKey:@"created_at"]] ?: [NSDate date]; - message.id = [(NSDictionary *)objMessage objectForKey:@"id"]; + message.identifier = [(NSDictionary *)objMessage objectForKey:@"id"]; message.status = BITFeedbackMessageStatusUnread; for (NSDictionary *attachmentData in objMessage[@"attachments"]) { BITFeedbackMessageAttachment *newAttachment = [BITFeedbackMessageAttachment new]; newAttachment.originalFilename = attachmentData[@"file_name"]; - newAttachment.id = attachmentData[@"id"]; + newAttachment.identifier = attachmentData[@"id"]; newAttachment.sourceURL = attachmentData[@"url"]; newAttachment.contentType = attachmentData[@"content_type"]; [message addAttachmentsObject:newAttachment]; diff --git a/Classes/BITFeedbackMessage.h b/Classes/BITFeedbackMessage.h index b8165f6793..c33caa983d 100644 --- a/Classes/BITFeedbackMessage.h +++ b/Classes/BITFeedbackMessage.h @@ -72,7 +72,7 @@ typedef NS_ENUM(NSInteger, BITFeedbackMessageStatus) { @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *email; @property (nonatomic, copy) NSDate *date; -@property (nonatomic, copy) NSNumber *id; +@property (nonatomic, copy) NSNumber *identifier; @property (nonatomic, copy) NSString *token; @property (nonatomic, strong) NSArray *attachments; @property (nonatomic) BITFeedbackMessageStatus status; diff --git a/Classes/BITFeedbackMessage.m b/Classes/BITFeedbackMessage.m index 342da85dab..820bc9c623 100644 --- a/Classes/BITFeedbackMessage.m +++ b/Classes/BITFeedbackMessage.m @@ -44,7 +44,7 @@ _date = [[NSDate alloc] init]; _token = nil; _attachments = nil; - _id = [[NSNumber alloc] initWithInteger:0]; + _identifier = [[NSNumber alloc] initWithInteger:0]; _status = BITFeedbackMessageStatusSendPending; _userMessage = NO; } @@ -60,7 +60,7 @@ [encoder encodeObject:self.name forKey:@"name"]; [encoder encodeObject:self.email forKey:@"email"]; [encoder encodeObject:self.date forKey:@"date"]; - [encoder encodeObject:self.id forKey:@"id"]; + [encoder encodeObject:self.identifier forKey:@"id"]; [encoder encodeObject:self.attachments forKey:@"attachments"]; [encoder encodeInteger:self.status forKey:@"status"]; [encoder encodeBool:self.userMessage forKey:@"userMessage"]; @@ -74,7 +74,7 @@ self.name = [decoder decodeObjectForKey:@"name"]; self.email = [decoder decodeObjectForKey:@"email"]; self.date = [decoder decodeObjectForKey:@"date"]; - self.id = [decoder decodeObjectForKey:@"id"]; + self.identifier = [decoder decodeObjectForKey:@"id"]; self.attachments = [decoder decodeObjectForKey:@"attachments"]; self.status = (BITFeedbackMessageStatus)[decoder decodeIntegerForKey:@"status"]; self.userMessage = [decoder decodeBoolForKey:@"userMessage"]; diff --git a/Classes/BITFeedbackMessageAttachment.h b/Classes/BITFeedbackMessageAttachment.h index d79971391a..6654c79437 100644 --- a/Classes/BITFeedbackMessageAttachment.h +++ b/Classes/BITFeedbackMessageAttachment.h @@ -35,7 +35,7 @@ */ @interface BITFeedbackMessageAttachment : NSObject -@property (nonatomic, copy) NSNumber *id; +@property (nonatomic, copy) NSNumber *identifier; @property (nonatomic, copy) NSString *originalFilename; @property (nonatomic, copy) NSString *contentType; @property (nonatomic, copy) NSString *sourceURL; diff --git a/Classes/BITFeedbackMessageAttachment.m b/Classes/BITFeedbackMessageAttachment.m index 1315e702f8..5a5a93129c 100644 --- a/Classes/BITFeedbackMessageAttachment.m +++ b/Classes/BITFeedbackMessageAttachment.m @@ -72,8 +72,8 @@ - (instancetype)init { if ((self = [super init])) { - self.isLoading = NO; - self.thumbnailRepresentations = [NSMutableDictionary new]; + _isLoading = NO; + _thumbnailRepresentations = [NSMutableDictionary new]; _fm = [[NSFileManager alloc] init]; _cachePath = [bit_settingsDir() stringByAppendingPathComponent:kCacheFolderName]; diff --git a/Classes/BITFeedbackUserDataViewController.m b/Classes/BITFeedbackUserDataViewController.m index 50d0536d52..cc80d8304d 100644 --- a/Classes/BITFeedbackUserDataViewController.m +++ b/Classes/BITFeedbackUserDataViewController.m @@ -54,8 +54,6 @@ - (instancetype)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { - self.title = BITHockeyLocalizedString(@"HockeyFeedbackUserDataTitle"); - _delegate = nil; _manager = [BITHockeyManager sharedHockeyManager].feedbackManager; @@ -68,6 +66,8 @@ - (void)viewDidLoad { [super viewDidLoad]; + self.title = BITHockeyLocalizedString(@"HockeyFeedbackUserDataTitle"); + [self.tableView setScrollEnabled:NO]; }