-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
247 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
BVSDK/BVConversations/Display/Sorting & Filtering/BVReviewsCustomOrderSortOptionValue.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// BVReviewsCustomOrderSortOptionValue.h | ||
// BVSDK | ||
// | ||
// Copyright © 2022 Bazaarvoice. All rights reserved. | ||
// | ||
#import <Foundation/Foundation.h> | ||
|
||
typedef NS_ENUM(NSInteger, BVReviewsCustomOrderSortOptionValue) { | ||
BVReviewsCustomOrderSortOptionValueContentLocale | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
BVSDK/BVConversations/Display/Sorting & Filtering/Private/BVCustomSortOrder.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// BVCustomSortOrder.h | ||
// BVSDK | ||
// | ||
// Copyright © 2022 Bazaarvoice. All rights reserved. | ||
// | ||
#import "BVSort.h" | ||
|
||
@interface BVCustomSortOrder : NSObject <BVCustomSortOrderProtocol> | ||
|
||
+ (nonnull instancetype)customSortOrderWithValues:(nonnull NSArray<NSString *> *)values; | ||
- (nonnull instancetype)initWithCustomSortOrderValues: | ||
(nonnull NSArray<NSString *> *)values; | ||
- (nonnull instancetype)__unavailable init; | ||
|
||
|
||
@end |
38 changes: 38 additions & 0 deletions
38
BVSDK/BVConversations/Display/Sorting & Filtering/Private/BVCustomSortOrder.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// BVCustomSortOrder.m | ||
// BVSDK | ||
// | ||
// Copyright © 2022 Bazaarvoice. All rights reserved. | ||
// | ||
|
||
#import "BVCustomSortOrder.h" | ||
#import "BVCommaUtil.h" | ||
|
||
@interface BVCustomSortOrder () | ||
@property(nonnull, nonatomic, strong) NSString *value; | ||
@end | ||
|
||
@implementation BVCustomSortOrder | ||
|
||
+ (nonnull NSString *)toCustomSortOrderParameterStringWithValues:(nonnull NSArray<NSString *> *)values | ||
{ | ||
return [BVCustomSortOrder customSortOrderWithValues:values].value; | ||
} | ||
|
||
+ (nonnull instancetype)customSortOrderWithValues:(nonnull NSArray<NSString *> *)values { | ||
return [[BVCustomSortOrder alloc] initWithCustomSortOrderValues:values]; | ||
} | ||
|
||
- (nonnull NSString *)toCustomSortOrderParameterString { | ||
return self.value; | ||
} | ||
|
||
- (nonnull instancetype)initWithCustomSortOrderValues: | ||
(nonnull NSArray<NSString *> *)values { | ||
if ((self = [super init])) { | ||
self.value = [[BVCommaUtil escapeMultiple:values] componentsJoinedByString:@","]; | ||
} | ||
return self; | ||
} | ||
|
||
@end |
16 changes: 16 additions & 0 deletions
16
BVSDK/BVConversations/Display/Sorting & Filtering/Private/BVReviewsCustomOrderSortOption.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// BVReviewsCustomOrderCustomOrderSortOption.h | ||
// BVSDK | ||
// | ||
// Copyright © 2022 Bazaarvoice. All rights reserved. | ||
// | ||
|
||
#import "BVReviewsCustomOrderSortOptionValue.h" | ||
#import "BVSortOption.h" | ||
|
||
@interface BVReviewsCustomOrderSortOption : BVSortOption | ||
|
||
- (nonnull instancetype)initWithReviewsSortOptionValue: | ||
(BVReviewsCustomOrderSortOptionValue)reviewsSortOptionValue; | ||
|
||
@end |
38 changes: 38 additions & 0 deletions
38
BVSDK/BVConversations/Display/Sorting & Filtering/Private/BVReviewsCustomOrderSortOption.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#import "BVReviewsCustomOrderSortOption.h" | ||
|
||
@interface BVReviewsCustomOrderSortOption () | ||
@property(nonnull, nonatomic, strong) NSString *value; | ||
@end | ||
|
||
@implementation BVReviewsCustomOrderSortOption | ||
|
||
+ (nonnull NSString *)toSortOptionParameterStringWithRawValue: | ||
(NSInteger)rawValue { | ||
return [BVReviewsCustomOrderSortOption sortOptionWithRawValue:rawValue].value; | ||
} | ||
|
||
+ (nonnull instancetype)sortOptionWithRawValue:(NSInteger)rawValue { | ||
return [[BVReviewsCustomOrderSortOption alloc] initWithRawValue:rawValue]; | ||
} | ||
|
||
- (nonnull instancetype)initWithRawValue:(NSInteger)rawValue { | ||
if ((self = [super initWithRawValue:rawValue])) { | ||
switch (rawValue) { | ||
case BVReviewsCustomOrderSortOptionValueContentLocale: | ||
self.value = @"ContentLocale"; | ||
break; | ||
} | ||
} | ||
return self; | ||
} | ||
|
||
- (nonnull NSString *)toSortOptionParameterString { | ||
return self.value; | ||
} | ||
|
||
- (nonnull instancetype)initWithReviewsSortOptionValue: | ||
(BVReviewsCustomOrderSortOptionValue)reviewsSortOptionValue { | ||
return [BVReviewsCustomOrderSortOption sortOptionWithRawValue:reviewsSortOptionValue]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.