Skip to content

Commit 170b85a

Browse files
author
Diego Serrano
committed
Survey customizations support
1 parent 501a7b6 commit 170b85a

28 files changed

+383
-116
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.28.0 (2024-05-23)
2+
3+
### Changes:
4+
5+
- Survey customizations
6+
17
## 0.27.1 (2024-03-22)
28

39
### Changes:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The easiest way to get Wootric into your iOS project is to use [CocoaPods](http:
2828

2929
2. Create a file in your Xcode project called Podfile and add the following line:
3030
```ruby
31-
pod "WootricSDK", "~> 0.27.1"
31+
pod "WootricSDK", "~> 0.28.0"
3232
```
3333

3434
3. In your Xcode project directory run the following command:

WootricSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'WootricSDK'
3-
s.version = '0.27.1'
3+
s.version = '0.28.0'
44
s.license = 'MIT'
55
s.summary = 'Wootric SDK for displaying survey for end user.'
66
s.homepage = 'https://github.com/Wootric/WootricSDK-iOS'

WootricSDK/WootricSDK.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
3E4AAE1C2925732300F6CC87 /* WTRCollectionViewCenterLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E4AAE1A2925732300F6CC87 /* WTRCollectionViewCenterLayout.m */; };
3636
3E4AAE1F292578C700F6CC87 /* WTRCollectionViewRow.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E4AAE1D292578C700F6CC87 /* WTRCollectionViewRow.h */; };
3737
3E4AAE20292578C700F6CC87 /* WTRCollectionViewRow.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E4AAE1E292578C700F6CC87 /* WTRCollectionViewRow.m */; };
38+
3E6B96362BB770EA00734D2B /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3E6B96352BB770EA00734D2B /* PrivacyInfo.xcprivacy */; };
3839
3E7893FE28B93D0D00E7D1BB /* WTRDriverPicklistCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E7893FC28B93D0D00E7D1BB /* WTRDriverPicklistCollectionViewCell.h */; };
3940
3E7893FF28B93D0D00E7D1BB /* WTRDriverPicklistCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E7893FD28B93D0D00E7D1BB /* WTRDriverPicklistCollectionViewCell.m */; };
4041
3EEB95AA2B85860E00BEBBE1 /* WTRiPADFooterView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEB95A82B85860E00BEBBE1 /* WTRiPADFooterView.h */; };
@@ -174,6 +175,7 @@
174175
3E4AAE1A2925732300F6CC87 /* WTRCollectionViewCenterLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WTRCollectionViewCenterLayout.m; sourceTree = "<group>"; };
175176
3E4AAE1D292578C700F6CC87 /* WTRCollectionViewRow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WTRCollectionViewRow.h; sourceTree = "<group>"; };
176177
3E4AAE1E292578C700F6CC87 /* WTRCollectionViewRow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WTRCollectionViewRow.m; sourceTree = "<group>"; };
178+
3E6B96352BB770EA00734D2B /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
177179
3E7893FC28B93D0D00E7D1BB /* WTRDriverPicklistCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WTRDriverPicklistCollectionViewCell.h; sourceTree = "<group>"; };
178180
3E7893FD28B93D0D00E7D1BB /* WTRDriverPicklistCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WTRDriverPicklistCollectionViewCell.m; sourceTree = "<group>"; };
179181
3EEB95A82B85860E00BEBBE1 /* WTRiPADFooterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WTRiPADFooterView.h; sourceTree = "<group>"; };
@@ -547,6 +549,7 @@
547549
3EF70E162626734C00FAE414 /* IBMPlexSans-Regular.ttf */,
548550
0FD5920E1D99EAFF00DD173B /* fontawesome-webfont.ttf */,
549551
0F04153A1FA8F11000E3C926 /* Info.plist */,
552+
3E6B96352BB770EA00734D2B /* PrivacyInfo.xcprivacy */,
550553
);
551554
name = "Supporting Files";
552555
sourceTree = "<group>";
@@ -733,6 +736,7 @@
733736
isa = PBXResourcesBuildPhase;
734737
buildActionMask = 2147483647;
735738
files = (
739+
3E6B96362BB770EA00734D2B /* PrivacyInfo.xcprivacy in Resources */,
736740
0FD5920F1D99EB0500DD173B /* fontawesome-webfont.ttf in Resources */,
737741
3EF70E1D2626734C00FAE414 /* IBMPlexSans-Bold.ttf in Resources */,
738742
3EF70E222626734C00FAE414 /* IBMPlexSans-Italic.ttf in Resources */,
@@ -980,7 +984,7 @@
980984
"@loader_path/Frameworks",
981985
);
982986
MACH_O_TYPE = mh_dylib;
983-
MARKETING_VERSION = 0.27.1;
987+
MARKETING_VERSION = 0.28.0;
984988
MODULEMAP_FILE = "";
985989
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
986990
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
@@ -1014,7 +1018,7 @@
10141018
"@loader_path/Frameworks",
10151019
);
10161020
MACH_O_TYPE = mh_dylib;
1017-
MARKETING_VERSION = 0.27.1;
1021+
MARKETING_VERSION = 0.28.0;
10181022
MODULEMAP_FILE = "";
10191023
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
10201024
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyAccessedAPITypes</key>
6+
<array>
7+
<dict>
8+
<key>NSPrivacyAccessedAPIType</key>
9+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
10+
<key>NSPrivacyAccessedAPITypeReasons</key>
11+
<array>
12+
<string>CA92.1</string>
13+
</array>
14+
</dict>
15+
</array>
16+
</dict>
17+
</plist>

WootricSDK/WootricSDK/UIItems.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ + (UILabel *)followupLabelWithTextColor:(UIColor *)textColor {
104104

105105
+ (UILabel *)feedbackPlaceholder {
106106
UILabel *tempLabel = [[UILabel alloc] init];
107-
tempLabel.textColor = [WTRColor textAreaTextColor];
107+
tempLabel.textColor = [WTRColor textAreaPlaceholderColor];
108108
tempLabel.font = [self regularFontWithSize:16];
109109
tempLabel.numberOfLines = 0;
110110
tempLabel.lineBreakMode = NSLineBreakByWordWrapping;

WootricSDK/WootricSDK/WTRCircleScoreButton.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828

2929
@property (nonatomic, assign) BOOL isSelected;
3030
@property (nonatomic, assign) int assignedScore;
31+
@property (nonatomic, assign) NSString *scoreScaleType;
3132

32-
- (instancetype)initWithViewController:(UIViewController *)viewController;
33+
- (instancetype)initWithViewController:(UIViewController *)viewController color:(UIColor *)color scoreScaleType:(NSString *)scoreScaleType;
3334
- (void)addConstraintsWithSuperview:(UIView *)superView andLeftConstraintConstant:(CGFloat)leftConstant;
3435
- (void)markAsSelected;
3536
- (void)markAsUnselected;

WootricSDK/WootricSDK/WTRCircleScoreButton.m

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,25 @@
2727
#import "SimpleConstraints.h"
2828
#import "UIItems.h"
2929

30+
@interface WTRCircleScoreButton ()
31+
32+
@property (nonatomic, strong) UIColor *sliderColor;
33+
34+
@end
35+
3036
@implementation WTRCircleScoreButton
3137

32-
- (instancetype)initWithViewController:(UIViewController *)viewController {
38+
- (instancetype)initWithViewController:(UIViewController *)viewController color:(UIColor *)color scoreScaleType:(NSString *)scoreScaleType {
3339
if (self = [super init]) {
3440
_isSelected = NO;
41+
_sliderColor = color;
42+
_scoreScaleType = scoreScaleType;
43+
self.backgroundColor = [scoreScaleType isEqualToString:@"filled"] ? _sliderColor : [UIColor whiteColor];
3544
self.layer.cornerRadius = 21;
3645
self.layer.borderWidth = 1;
3746
self.layer.borderColor = [WTRColor iPadCircleButtonBorderColor].CGColor;
3847
self.titleLabel.font = [UIItems regularFontWithSize:14];
39-
[self setTitleColor:[WTRColor iPadCircleButtonTextColor] forState:UIControlStateNormal];
48+
[self setTitleColor:[WTRColor iPadCircleButtonTextColorForColor:_sliderColor scoreScaleType:_scoreScaleType state:false] forState:UIControlStateNormal];
4049
[self setTranslatesAutoresizingMaskIntoConstraints:NO];
4150
[self setupConstraints];
4251
[self addTarget:viewController action:NSSelectorFromString(@"selectScore:") forControlEvents:UIControlEventTouchUpInside];
@@ -73,16 +82,20 @@ - (void)addConstraintsWithSuperview:(UIView *)superView andLeftConstraintConstan
7382

7483
- (void)markAsSelected {
7584
_isSelected = YES;
76-
self.backgroundColor = [WTRColor iPadCircleButtonSelectedBackgroundColor];
77-
self.layer.borderColor = [WTRColor iPadCircleButtonSelectedBorderColor].CGColor;
78-
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
85+
if (_sliderColor) {
86+
self.backgroundColor = _sliderColor;
87+
} else {
88+
self.backgroundColor = [WTRColor iPadCircleButtonSelectedBackgroundColor];
89+
}
90+
self.layer.borderColor = [WTRColor iPadCircleButtonBorderColor].CGColor;
91+
[self setTitleColor:[WTRColor iPadCircleButtonTextColorForColor:_sliderColor scoreScaleType:_scoreScaleType state:true] forState:UIControlStateNormal];
7992
}
8093

8194
- (void)markAsUnselected {
8295
_isSelected = NO;
8396
self.backgroundColor = [UIColor whiteColor];
8497
self.layer.borderColor = [WTRColor iPadCircleButtonBorderColor].CGColor;
85-
[self setTitleColor:[WTRColor iPadCircleButtonTextColor] forState:UIControlStateNormal];
98+
[self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
8699
}
87100

88101
@end

WootricSDK/WootricSDK/WTRCircleScoreView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ - (void)setupConstraints {
4545

4646
- (void)addCircleButtonsWithViewController:(UIViewController *)viewController {
4747
for (int i = [_settings minimumScore]; i <= [_settings maximumScore]; i++) {
48-
WTRCircleScoreButton *circleButton = [[WTRCircleScoreButton alloc] initWithViewController:viewController];
48+
WTRCircleScoreButton *circleButton = [[WTRCircleScoreButton alloc] initWithViewController:viewController color:_settings.sliderColor scoreScaleType:_settings.scoreScaleType];
4949
circleButton.tag = 9000 + i;
5050
circleButton.assignedScore = i;
5151
[circleButton setTitle:[NSString stringWithFormat:@"%d", i] forState:UIControlStateNormal];

WootricSDK/WootricSDK/WTRColor.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737
+ (UIColor *)anchorAndScoreColor;
3838
+ (UIColor *)sendButtonBackgroundColor;
3939
+ (UIColor *)sendButtonDisabledBackgroundColor;
40+
+ (UIColor *)sendButtonTextColorForColor:(UIColor *)color;
4041
+ (UIColor *)poweredByColor;
4142
+ (UIColor *)optOutTextColor;
42-
+ (UIColor *)wootricTextColor;
43+
+ (UIColor *)wootricTextColorForColor:(UIColor *)color;
4344
+ (UIColor *)sliderValueColor;
4445
+ (UIColor *)sliderDotSelectedColor;
4546
+ (UIColor *)selectedValueDotColor;
@@ -48,23 +49,29 @@
4849
+ (UIColor *)editScoreTextColor;
4950
+ (UIColor *)textAreaBorderColor;
5051
+ (UIColor *)textAreaTextColor;
52+
+ (UIColor *)textAreaPlaceholderColor;
5153
+ (UIColor *)textAreaCursorColor;
5254
+ (UIColor *)callToActionButtonBackgroundColor;
5355
+ (UIColor *)socialShareQuestionTextColor;
56+
+ (UIColor *)noThanksButtonTextColor;
5457
+ (UIColor *)facebookLogoTextColor;
5558
+ (UIColor *)twitterLogoTextColor;
5659

5760
+ (UIColor *)iPadCircleButtonBorderColor;
58-
+ (UIColor *)iPadCircleButtonTextColor;
61+
+ (UIColor *)iPadCircleButtonTextColorForColor:(UIColor *)color scoreScaleType:(NSString *)scoreScaleType state:(BOOL)isSelected;
5962
+ (UIColor *)iPadCircleButtonSelectedBackgroundColor;
6063
+ (UIColor *)iPadCircleButtonSelectedBorderColor;
6164
+ (UIColor *)iPadPoweredByWootricTextColor;
6265
+ (UIColor *)iPadQuestionsTextColor;
6366
+ (UIColor *)iPadFeedbackTextViewBackgroundColor;
6467
+ (UIColor *)iPadSendButtonBackgroundColor;
6568
+ (UIColor *)iPadThankYouButtonBorderColor;
66-
+ (UIColor *)iPadThankYouButtonTextColor;
69+
+ (UIColor *)iPadThankYouButtonTextColorForColor:(UIColor *)color;
6770
+ (UIColor *)iPadNoThanksButtonBorderColor;
6871
+ (UIColor *)iPadNoThanksButtonTextColor;
6972

73+
+ (UIColor *)lighterColor:(UIColor *)color byPercetage:(CGFloat)percentage;
74+
+ (UIColor *)darkerColor:(UIColor *)color byPercentage:(CGFloat)percentage;
75+
+ (UIColor *)colorWithHexString:(NSString *)hexString;
76+
7077
@end

0 commit comments

Comments
 (0)