Skip to content

Commit 62abfb5

Browse files
authored
Merge pull request #575 from apptentive/hotfix/mc-donalds-accessibility
McDonalds accessibility fixes
2 parents 74bdf7c + 4625320 commit 62abfb5

7 files changed

+22
-5
lines changed

Apptentive/Apptentive/Apptentive.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ FOUNDATION_EXPORT double ApptentiveVersionNumber;
2020
FOUNDATION_EXPORT const unsigned char ApptentiveVersionString[];
2121

2222
/** The version number of the Apptentive SDK. */
23-
#define kApptentiveVersionString @"5.0.0"
23+
#define kApptentiveVersionString @"5.0.1"
2424

2525
/** The version number of the Apptentive API platform. */
2626
#define kApptentiveAPIVersionString @"9"

Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewController.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
240240
cell.textField.delegate = self;
241241
cell.textField.tag = [self.viewModel textFieldTagForIndexPath:indexPath];
242242
cell.textField.font = [self.viewModel.styleSheet fontForStyle:ApptentiveTextStyleTextInput];
243+
cell.textField.accessibilityLabel = cell.textField.placeholder;
243244
cell.textField.textColor = [self.viewModel.styleSheet colorForStyle:ApptentiveTextStyleTextInput];
244245

245246
return cell;
@@ -337,7 +338,7 @@ - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView
337338
view.textLabel.text = [self.viewModel textOfQuestionAtIndex:indexPath.section];
338339
view.textLabel.font = [self.viewModel.styleSheet fontForStyle:UIFontTextStyleBody];
339340
view.textLabel.textColor = [self.viewModel.styleSheet colorForStyle:UIFontTextStyleBody];
340-
341+
view.textLabel.accessibilityHint = [self.viewModel accessibilityHintForQuestionAtIndexPath:indexPath];
341342
view.instructionsTextLabel.attributedText = [self.viewModel instructionTextOfQuestionAtIndex:indexPath.section];
342343
view.instructionsTextLabel.font = [self.viewModel.styleSheet fontForStyle:ApptentiveTextStyleSurveyInstructions];
343344

Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewModel.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
4545
- (NSString *)textOfQuestionAtIndex:(NSInteger)index;
4646
- (nullable NSAttributedString *)instructionTextOfQuestionAtIndex:(NSInteger)index;
4747
- (NSAttributedString *)placeholderTextOfAnswerAtIndexPath:(NSIndexPath *)indexPath;
48+
- (nullable NSString *)accessibilityHintForQuestionAtIndexPath:(NSIndexPath *)indexPath;
4849
- (ATSurveyQuestionType)typeOfQuestionAtIndex:(NSInteger)index;
4950
- (ApptentiveSurveyAnswerType)typeOfAnswerAtIndexPath:(NSIndexPath *)indexPath;
5051

Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewModel.m

+9
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ - (BOOL)answerIsSelectedAtIndexPath:(NSIndexPath *)indexPath {
156156
return [self.selectedIndexPaths containsObject:indexPath];
157157
}
158158

159+
- (nullable NSString *)accessibilityHintForQuestionAtIndexPath:(NSIndexPath *)indexPath {
160+
ApptentiveSurveyQuestion *question = [self questionAtIndex:indexPath.section];
161+
if (question.required) {
162+
return ApptentiveLocalizedString(@"required", @"Required answer hint");
163+
}
164+
165+
return nil;
166+
}
167+
159168
- (ATSurveyQuestionType)typeOfQuestionAtIndex:(NSInteger)index {
160169
return [self questionAtIndex:index].type;
161170
}

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2018-01-30 frankus, weeebox v5.0.1
2+
----------------------------------
3+
###Improvements
4+
5+
- Accessibility improvements for VoiceOver.
6+
17
2017-12-15 frankus, weeebox v5.0.0
28
----------------------------------
39
###Improvements

Example/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- apptentive-ios (5.0.0)
2+
- apptentive-ios (5.0.1)
33

44
DEPENDENCIES:
55
- apptentive-ios (from `..`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: ..
1010

1111
SPEC CHECKSUMS:
12-
apptentive-ios: f473d64b41e3c28a1f5824399f38f0f037303066
12+
apptentive-ios: bfaa33a5bd2f345d697038bf81f46b3010642f26
1313

1414
PODFILE CHECKSUM: fb7822acbd17e9b6c60d2db75808647cc370b6a0
1515

apptentive-ios.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = 'apptentive-ios'
33
s.module_name = 'Apptentive'
4-
s.version = '5.0.0'
4+
s.version = '5.0.1'
55
s.license = 'BSD'
66
s.summary = 'Apptentive Customer Communications SDK.'
77
s.homepage = 'https://www.apptentive.com/'

0 commit comments

Comments
 (0)