Skip to content

Commit

Permalink
Auto format
Browse files Browse the repository at this point in the history
  • Loading branch information
frankus committed Aug 10, 2016
1 parent 86a9b2c commit 5c41168
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion ApptentiveConnect/source/Apptentive+Debugging.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly, nonatomic, nullable) NSString *conversationToken;
@property (strong, nonatomic, nullable) NSURL *localInteractionsURL;

- (NSArray <NSString *>*)engagementEvents;
- (NSArray<NSString *> *)engagementEvents;
- (NSArray *)engagementInteractions;
- (NSString *)engagementInteractionNameAtIndex:(NSInteger)index;
- (NSString *)engagementInteractionTypeAtIndex:(NSInteger)index;
Expand Down
6 changes: 3 additions & 3 deletions ApptentiveConnect/source/Apptentive.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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<NSDictionary *> *)extendedData fromViewController:(UIViewController * _Nullable)viewController;
- (BOOL)engage:(NSString *)event withCustomData:(nullable NSDictionary *)customData withExtendedData:(nullable NSArray<NSDictionary *> *)extendedData fromViewController:(UIViewController *_Nullable)viewController;

/**
Dismisses Message Center.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ extern NSString *const ApptentiveEngagementMessageCenterEvent;

- (void)resetUpgradeVersionInfo;
- (NSArray *)allEngagementInteractions;
- (NSArray <NSString *>*)targetedLocalEvents;
- (NSArray<NSString *> *)targetedLocalEvents;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "ApptentiveAttachButton.h"


@interface ApptentiveAttachButton ()

@property (strong, nonatomic) NSNumberFormatter *numberFormatter;
Expand Down
1 change: 1 addition & 0 deletions ApptentiveConnect/source/Metrics/ApptentiveMetrics.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
static NSString *ATInteractionAppEventLabelLaunch = @"launch";
static NSString *ATInteractionAppEventLabelExit = @"exit";


@interface ApptentiveMetrics ()

- (void)addLaunchMetric;
Expand Down
2 changes: 1 addition & 1 deletion ApptentiveConnect/source/Misc/ApptentiveUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ + (NSArray *)availableAppLocalizations {
[localizations addObject:s];
}
}
localAppLocalizations = [NSArray arrayWithArray:localizations];
localAppLocalizations = [NSArray arrayWithArray:localizations];
}
}
return localAppLocalizations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -65,7 +65,6 @@ - (instancetype)initWithJSON:(NSDictionary *)JSON {
}

_answers = [mutableAnswers copy];

}

return self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,15 @@ - (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 {
[self.interaction engage:ApptentiveInteractionSurveyEventLabelCancel fromViewController: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];
}

Expand All @@ -415,7 +415,7 @@ - (ApptentiveSurveyAnswer *)answerAtIndexPath:(NSIndexPath *)indexPath {
return answers.count > (NSUInteger)indexPath.row ? answers[indexPath.row] : nil;
}

- (NSArray <NSIndexPath *>*)selectedIndexPathsForQuestionAtIndex:(NSInteger)index {
- (NSArray<NSIndexPath *> *)selectedIndexPathsForQuestionAtIndex:(NSInteger)index {
NSMutableArray *result = [NSMutableArray array];

for (NSIndexPath *indexPath in self.selectedIndexPaths) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import <UIKit/UIKit.h>


@interface ApptentiveSurveyQuestionFooterView : UICollectionReusableView

@property (strong, nonatomic) IBOutlet UILabel *minimumLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "ApptentiveSurveyQuestionFooterView.h"


@implementation ApptentiveSurveyQuestionFooterView

@end
2 changes: 1 addition & 1 deletion ApptentiveConnect/source/URL Loading/ATConnectionChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ - (void)update {

@synchronized(self) {
@autoreleasepool {
while ([self.active count] < self.maximumConnections && [self.waiting count]> 0) {
while ([self.active count]<self.maximumConnections && [self.waiting count]> 0) {
ApptentiveURLConnection *loader = [self.waiting objectAtIndex:0];
[self.active addObject:loader];
[loader addObserver:self forKeyPath:@"isFinished" options:NSKeyValueObservingOptionNew context:NULL];
Expand Down
4 changes: 2 additions & 2 deletions ApptentiveConnect/tests/ApptentiveSurveyTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand All @@ -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]);
}
Expand Down

0 comments on commit 5c41168

Please sign in to comment.