diff --git a/ApptentiveConnect/source/Apptentive+Debugging.h b/ApptentiveConnect/source/Apptentive+Debugging.h index 2270059d0..0aa56ed6a 100644 --- a/ApptentiveConnect/source/Apptentive+Debugging.h +++ b/ApptentiveConnect/source/Apptentive+Debugging.h @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @property (readonly, nonatomic, nullable) NSString *conversationToken; @property (strong, nonatomic, nullable) NSURL *localInteractionsURL; -- (NSArray *)engagementEvents; +- (NSArray *)engagementEvents; - (NSArray *)engagementInteractions; - (NSString *)engagementInteractionNameAtIndex:(NSInteger)index; - (NSString *)engagementInteractionTypeAtIndex:(NSInteger)index; diff --git a/ApptentiveConnect/source/Apptentive.h b/ApptentiveConnect/source/Apptentive.h index 48b7c6f5d..aeabf1d6e 100644 --- a/ApptentiveConnect/source/Apptentive.h +++ b/ApptentiveConnect/source/Apptentive.h @@ -250,7 +250,7 @@ Returns a Boolean value indicating whether the given event will cause an Interac @return `YES` if an interaction was triggered by the event, `NO` otherwise. */ -- (BOOL)engage:(NSString *)event fromViewController:( UIViewController * _Nullable)viewController; +- (BOOL)engage:(NSString *)event fromViewController:(UIViewController *_Nullable)viewController; /** Shows interaction UI, if applicable, related to a given event, and attaches the specified custom data to the event. @@ -261,7 +261,7 @@ Returns a Boolean value indicating whether the given event will cause an Interac @return `YES` if an interaction was triggered by the event, `NO` otherwise. */ -- (BOOL)engage:(NSString *)event withCustomData:(nullable NSDictionary *)customData fromViewController:(UIViewController * _Nullable)viewController; +- (BOOL)engage:(NSString *)event withCustomData:(nullable NSDictionary *)customData fromViewController:(UIViewController *_Nullable)viewController; /** Shows interaction UI, if applicable, related to a given event. Attaches the specified custom data to the event along with the specified extended data. @@ -273,7 +273,7 @@ Returns a Boolean value indicating whether the given event will cause an Interac @return `YES` if an interaction was triggered by the event, `NO` otherwise. */ -- (BOOL)engage:(NSString *)event withCustomData:(nullable NSDictionary *)customData withExtendedData:(nullable NSArray *)extendedData fromViewController:(UIViewController * _Nullable)viewController; +- (BOOL)engage:(NSString *)event withCustomData:(nullable NSDictionary *)customData withExtendedData:(nullable NSArray *)extendedData fromViewController:(UIViewController *_Nullable)viewController; /** Dismisses Message Center. diff --git a/ApptentiveConnect/source/Engagement/Interactions/ApptentiveInteractionController.m b/ApptentiveConnect/source/Engagement/Interactions/ApptentiveInteractionController.m index 9a81d408c..b42dfd37b 100644 --- a/ApptentiveConnect/source/Engagement/Interactions/ApptentiveInteractionController.m +++ b/ApptentiveConnect/source/Engagement/Interactions/ApptentiveInteractionController.m @@ -19,20 +19,20 @@ + (void)registerInteractionControllerClass:(Class) class forType:(NSString *)typ dispatch_once(&onceToken, ^{ interactionControllerClassRegistry = @{}; }); - - @synchronized ([ApptentiveInteractionController class]) { - NSMutableDictionary *registry = [interactionControllerClassRegistry mutableCopy]; - registry[type] = class; - interactionControllerClassRegistry = [NSDictionary dictionaryWithDictionary:registry]; - } + + @synchronized([ApptentiveInteractionController class]) { + NSMutableDictionary *registry = [interactionControllerClassRegistry mutableCopy]; + registry[type] = class; + interactionControllerClassRegistry = [NSDictionary dictionaryWithDictionary:registry]; + } } -+ (Class)interactionControllerClassWithType:(NSString *)type { - Class result; - @synchronized ([ApptentiveInteractionController class]) { - result = interactionControllerClassRegistry[type]; - } - return result; + + (Class)interactionControllerClassWithType : (NSString *)type { + Class result; + @synchronized([ApptentiveInteractionController class]) { + result = interactionControllerClassRegistry[type]; + } + return result; } + (instancetype)interactionControllerWithInteraction:(ApptentiveInteraction *)interaction { diff --git a/ApptentiveConnect/source/Engagement/Interactions/Surveys/ApptentiveInteractionSurveyController.m b/ApptentiveConnect/source/Engagement/Interactions/Surveys/ApptentiveInteractionSurveyController.m index 9c819e172..3e68e413a 100644 --- a/ApptentiveConnect/source/Engagement/Interactions/Surveys/ApptentiveInteractionSurveyController.m +++ b/ApptentiveConnect/source/Engagement/Interactions/Surveys/ApptentiveInteractionSurveyController.m @@ -34,7 +34,7 @@ - (void)presentInteractionFromViewController:(UIViewController *)viewController [viewController presentViewController:navigationController animated:YES completion:nil]; } - [[NSNotificationCenter defaultCenter] postNotificationName:ApptentiveSurveyShownNotification object:@{ ApptentiveSurveyIDKey: self.interaction.identifier }]; + [[NSNotificationCenter defaultCenter] postNotificationName:ApptentiveSurveyShownNotification object:@{ApptentiveSurveyIDKey: self.interaction.identifier}]; [self.interaction engage:ATInteractionSurveyEventLabelLaunch fromViewController:viewController]; } diff --git a/ApptentiveConnect/source/Engagement/Persistence/ApptentiveEngagementBackend.h b/ApptentiveConnect/source/Engagement/Persistence/ApptentiveEngagementBackend.h index 38f95a6ae..a6bd21387 100644 --- a/ApptentiveConnect/source/Engagement/Persistence/ApptentiveEngagementBackend.h +++ b/ApptentiveConnect/source/Engagement/Persistence/ApptentiveEngagementBackend.h @@ -72,6 +72,6 @@ extern NSString *const ApptentiveEngagementMessageCenterEvent; - (void)resetUpgradeVersionInfo; - (NSArray *)allEngagementInteractions; -- (NSArray *)targetedLocalEvents; +- (NSArray *)targetedLocalEvents; @end diff --git a/ApptentiveConnect/source/Message Center/Controllers/ApptentiveMessageCenterViewController.m b/ApptentiveConnect/source/Message Center/Controllers/ApptentiveMessageCenterViewController.m index 54a9c1a1c..e35e0a973 100644 --- a/ApptentiveConnect/source/Message Center/Controllers/ApptentiveMessageCenterViewController.m +++ b/ApptentiveConnect/source/Message Center/Controllers/ApptentiveMessageCenterViewController.m @@ -137,8 +137,8 @@ - (void)viewDidLoad { [Apptentive sharedConnection].backend.messageDelegate = self; self.dateFormatter = [[NSDateFormatter alloc] init]; - self.dateFormatter.dateStyle = NSDateFormatterLongStyle; - self.dateFormatter.timeStyle = NSDateFormatterNoStyle; + self.dateFormatter.dateStyle = NSDateFormatterLongStyle; + self.dateFormatter.timeStyle = NSDateFormatterNoStyle; self.dataSource.dateFormatter.dateFormat = self.dateFormatter.dateFormat; // Used to determine if date changed between messages self.navigationItem.title = self.interaction.title; diff --git a/ApptentiveConnect/source/Message Center/Views/ApptentiveAttachButton.m b/ApptentiveConnect/source/Message Center/Views/ApptentiveAttachButton.m index 2cabdaa4c..8adb2f91c 100644 --- a/ApptentiveConnect/source/Message Center/Views/ApptentiveAttachButton.m +++ b/ApptentiveConnect/source/Message Center/Views/ApptentiveAttachButton.m @@ -8,6 +8,7 @@ #import "ApptentiveAttachButton.h" + @interface ApptentiveAttachButton () @property (strong, nonatomic) NSNumberFormatter *numberFormatter; diff --git a/ApptentiveConnect/source/Metrics/ApptentiveMetrics.m b/ApptentiveConnect/source/Metrics/ApptentiveMetrics.m index 8ddd91988..14b03cc59 100644 --- a/ApptentiveConnect/source/Metrics/ApptentiveMetrics.m +++ b/ApptentiveConnect/source/Metrics/ApptentiveMetrics.m @@ -23,6 +23,7 @@ static NSString *ATInteractionAppEventLabelLaunch = @"launch"; static NSString *ATInteractionAppEventLabelExit = @"exit"; + @interface ApptentiveMetrics () - (void)addLaunchMetric; diff --git a/ApptentiveConnect/source/Misc/ApptentiveUtilities.m b/ApptentiveConnect/source/Misc/ApptentiveUtilities.m index 049688d8b..9949c3cc2 100644 --- a/ApptentiveConnect/source/Misc/ApptentiveUtilities.m +++ b/ApptentiveConnect/source/Misc/ApptentiveUtilities.m @@ -238,7 +238,7 @@ + (NSArray *)availableAppLocalizations { [localizations addObject:s]; } } - localAppLocalizations = [NSArray arrayWithArray:localizations]; + localAppLocalizations = [NSArray arrayWithArray:localizations]; } } return localAppLocalizations; diff --git a/ApptentiveConnect/source/Surveys/Model/ApptentiveSurveyQuestion.m b/ApptentiveConnect/source/Surveys/Model/ApptentiveSurveyQuestion.m index 130deb269..16ea52fd1 100644 --- a/ApptentiveConnect/source/Surveys/Model/ApptentiveSurveyQuestion.m +++ b/ApptentiveConnect/source/Surveys/Model/ApptentiveSurveyQuestion.m @@ -49,13 +49,13 @@ - (instancetype)initWithJSON:(NSDictionary *)JSON { if (_type == ATSurveyQuestionTypeRange) { NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; - _minimumValue = [(JSON[@"min"] ?: @0) integerValue]; - _maximumValue = [(JSON[@"max"] ?: @10) integerValue]; + _minimumValue = [(JSON[@"min"] ?: @0)integerValue]; + _maximumValue = [(JSON[@"max"] ?: @10)integerValue]; _minimumLabel = JSON[@"min_label"]; _maximumLabel = JSON[@"max_label"]; - for (NSInteger i = _minimumValue; i <= _maximumValue; i ++) { + for (NSInteger i = _minimumValue; i <= _maximumValue; i++) { [mutableAnswers addObject:[[ApptentiveSurveyAnswer alloc] initWithValue:[numberFormatter stringFromNumber:@(i)]]]; } } else { @@ -65,7 +65,6 @@ - (instancetype)initWithJSON:(NSDictionary *)JSON { } _answers = [mutableAnswers copy]; - } return self; diff --git a/ApptentiveConnect/source/Surveys/View Controllers/ApptentiveSurveyViewController.m b/ApptentiveConnect/source/Surveys/View Controllers/ApptentiveSurveyViewController.m index 941730965..77731ce81 100644 --- a/ApptentiveConnect/source/Surveys/View Controllers/ApptentiveSurveyViewController.m +++ b/ApptentiveConnect/source/Surveys/View Controllers/ApptentiveSurveyViewController.m @@ -266,7 +266,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell if (detailText) { cell.accessibilityHint = detailText; } - + cell.accessibilityLabel = [self.viewModel textOfChoiceAtIndexPath:indexPath]; cell.accessibilityTraits |= UIAccessibilityTraitButton; cell.button.image = buttonImage; diff --git a/ApptentiveConnect/source/Surveys/View Controllers/ApptentiveSurveyViewModel.m b/ApptentiveConnect/source/Surveys/View Controllers/ApptentiveSurveyViewModel.m index c811d3a6a..050f766a3 100644 --- a/ApptentiveConnect/source/Surveys/View Controllers/ApptentiveSurveyViewModel.m +++ b/ApptentiveConnect/source/Surveys/View Controllers/ApptentiveSurveyViewModel.m @@ -391,7 +391,7 @@ - (NSDictionary *)answers { - (void)answerChangedAtIndexPath:(NSIndexPath *)indexPath { ApptentiveSurveyQuestion *question = [self questionAtIndex:indexPath.section]; - [self.interaction engage:ApptentiveInteractionSurveyEventLabelQuestionResponse fromViewController:nil userInfo:@{ @"id": question.identifier ?: [NSNull null]}]; + [self.interaction engage:ApptentiveInteractionSurveyEventLabelQuestionResponse fromViewController:nil userInfo:@{ @"id": question.identifier ?: [NSNull null] }]; } - (void)didCancel:(UIViewController *)presentingViewController { @@ -399,7 +399,7 @@ - (void)didCancel:(UIViewController *)presentingViewController { } - (void)didSubmit:(UIViewController *)presentingViewController { - [[NSNotificationCenter defaultCenter] postNotificationName:ApptentiveSurveySentNotification object:@{ ApptentiveSurveyIDKey: self.interaction.identifier }]; + [[NSNotificationCenter defaultCenter] postNotificationName:ApptentiveSurveySentNotification object:@{ApptentiveSurveyIDKey: self.interaction.identifier}]; [self.interaction engage:ApptentiveInteractionSurveyEventLabelSubmit fromViewController:presentingViewController]; } @@ -415,7 +415,7 @@ - (ApptentiveSurveyAnswer *)answerAtIndexPath:(NSIndexPath *)indexPath { return answers.count > (NSUInteger)indexPath.row ? answers[indexPath.row] : nil; } -- (NSArray *)selectedIndexPathsForQuestionAtIndex:(NSInteger)index { +- (NSArray *)selectedIndexPathsForQuestionAtIndex:(NSInteger)index { NSMutableArray *result = [NSMutableArray array]; for (NSIndexPath *indexPath in self.selectedIndexPaths) { diff --git a/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyChoiceCell.m b/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyChoiceCell.m index 76fab0d4c..3c569b90a 100644 --- a/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyChoiceCell.m +++ b/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyChoiceCell.m @@ -16,7 +16,7 @@ - (void)awakeFromNib { // We set the number of lines to zero here (rather than IB) to avoid an Xcode warning // for iOS 7. But we don't want to change the number of lines for range question types. - // Using the tag, we can customize this on a per cell-prototype basis. + // Using the tag, we can customize this on a per cell-prototype basis. self.textLabel.numberOfLines = self.textLabel.tag; [super awakeFromNib]; diff --git a/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyQuestionFooterView.h b/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyQuestionFooterView.h index 0dc02e12c..63fc7d637 100644 --- a/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyQuestionFooterView.h +++ b/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyQuestionFooterView.h @@ -8,6 +8,7 @@ #import + @interface ApptentiveSurveyQuestionFooterView : UICollectionReusableView @property (strong, nonatomic) IBOutlet UILabel *minimumLabel; diff --git a/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyQuestionFooterView.m b/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyQuestionFooterView.m index da340a05b..5fcee9bc3 100644 --- a/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyQuestionFooterView.m +++ b/ApptentiveConnect/source/Surveys/Views/ApptentiveSurveyQuestionFooterView.m @@ -8,6 +8,7 @@ #import "ApptentiveSurveyQuestionFooterView.h" + @implementation ApptentiveSurveyQuestionFooterView @end diff --git a/ApptentiveConnect/source/URL Loading/ATConnectionChannel.m b/ApptentiveConnect/source/URL Loading/ATConnectionChannel.m index 57f7d754f..14fd879e6 100644 --- a/ApptentiveConnect/source/URL Loading/ATConnectionChannel.m +++ b/ApptentiveConnect/source/URL Loading/ATConnectionChannel.m @@ -38,7 +38,7 @@ - (void)update { @synchronized(self) { @autoreleasepool { - while ([self.active count] < self.maximumConnections && [self.waiting count]> 0) { + while ([self.active count] 0) { ApptentiveURLConnection *loader = [self.waiting objectAtIndex:0]; [self.active addObject:loader]; [loader addObserver:self forKeyPath:@"isFinished" options:NSKeyValueObservingOptionNew context:NULL]; diff --git a/ApptentiveConnect/tests/ApptentiveSurveyTests.m b/ApptentiveConnect/tests/ApptentiveSurveyTests.m index 839b5b832..59e255c58 100644 --- a/ApptentiveConnect/tests/ApptentiveSurveyTests.m +++ b/ApptentiveConnect/tests/ApptentiveSurveyTests.m @@ -211,7 +211,7 @@ - (void)testTagForIndexPath { - (void)testRange { [self.viewModel selectAnswerAtIndexPath:[NSIndexPath indexPathForItem:2 inSection:10]]; - XCTAssertEqualObjects(self.viewModel.answers[@"56d49499c719925f33000022"], @[ @{ @"value": @-3 } ]); + XCTAssertEqualObjects(self.viewModel.answers[@"56d49499c719925f33000022"], @[@{ @"value": @-3 }]); XCTAssertFalse([self.viewModel validate:YES]); @@ -224,7 +224,7 @@ - (void)testRange { [self.viewModel selectAnswerAtIndexPath:[NSIndexPath indexPathForItem:5 inSection:11]]; - XCTAssertEqualObjects(self.viewModel.answers[@"56d49499c719925f33000023"], @[ @{ @"value": @5 } ]); + XCTAssertEqualObjects(self.viewModel.answers[@"56d49499c719925f33000023"], @[@{ @"value": @5 }]); XCTAssertTrue([self.viewModel validate:YES]); }