Skip to content

Commit

Permalink
Merge pull request #575 from apptentive/hotfix/mc-donalds-accessibility
Browse files Browse the repository at this point in the history
McDonalds accessibility fixes
  • Loading branch information
frankus committed Jan 30, 2018
2 parents 74bdf7c + 4625320 commit 62abfb5
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Apptentive/Apptentive/Apptentive.h
Expand Up @@ -20,7 +20,7 @@ FOUNDATION_EXPORT double ApptentiveVersionNumber;
FOUNDATION_EXPORT const unsigned char ApptentiveVersionString[];

/** The version number of the Apptentive SDK. */
#define kApptentiveVersionString @"5.0.0"
#define kApptentiveVersionString @"5.0.1"

/** The version number of the Apptentive API platform. */
#define kApptentiveAPIVersionString @"9"
Expand Down
Expand Up @@ -240,6 +240,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
cell.textField.delegate = self;
cell.textField.tag = [self.viewModel textFieldTagForIndexPath:indexPath];
cell.textField.font = [self.viewModel.styleSheet fontForStyle:ApptentiveTextStyleTextInput];
cell.textField.accessibilityLabel = cell.textField.placeholder;
cell.textField.textColor = [self.viewModel.styleSheet colorForStyle:ApptentiveTextStyleTextInput];

return cell;
Expand Down Expand Up @@ -337,7 +338,7 @@ - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView
view.textLabel.text = [self.viewModel textOfQuestionAtIndex:indexPath.section];
view.textLabel.font = [self.viewModel.styleSheet fontForStyle:UIFontTextStyleBody];
view.textLabel.textColor = [self.viewModel.styleSheet colorForStyle:UIFontTextStyleBody];

view.textLabel.accessibilityHint = [self.viewModel accessibilityHintForQuestionAtIndexPath:indexPath];
view.instructionsTextLabel.attributedText = [self.viewModel instructionTextOfQuestionAtIndex:indexPath.section];
view.instructionsTextLabel.font = [self.viewModel.styleSheet fontForStyle:ApptentiveTextStyleSurveyInstructions];

Expand Down
Expand Up @@ -45,6 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
- (NSString *)textOfQuestionAtIndex:(NSInteger)index;
- (nullable NSAttributedString *)instructionTextOfQuestionAtIndex:(NSInteger)index;
- (NSAttributedString *)placeholderTextOfAnswerAtIndexPath:(NSIndexPath *)indexPath;
- (nullable NSString *)accessibilityHintForQuestionAtIndexPath:(NSIndexPath *)indexPath;
- (ATSurveyQuestionType)typeOfQuestionAtIndex:(NSInteger)index;
- (ApptentiveSurveyAnswerType)typeOfAnswerAtIndexPath:(NSIndexPath *)indexPath;

Expand Down
Expand Up @@ -156,6 +156,15 @@ - (BOOL)answerIsSelectedAtIndexPath:(NSIndexPath *)indexPath {
return [self.selectedIndexPaths containsObject:indexPath];
}

- (nullable NSString *)accessibilityHintForQuestionAtIndexPath:(NSIndexPath *)indexPath {
ApptentiveSurveyQuestion *question = [self questionAtIndex:indexPath.section];
if (question.required) {
return ApptentiveLocalizedString(@"required", @"Required answer hint");
}

return nil;
}

- (ATSurveyQuestionType)typeOfQuestionAtIndex:(NSInteger)index {
return [self questionAtIndex:index].type;
}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
2018-01-30 frankus, weeebox v5.0.1
----------------------------------
###Improvements

- Accessibility improvements for VoiceOver.

2017-12-15 frankus, weeebox v5.0.0
----------------------------------
###Improvements
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
@@ -1,5 +1,5 @@
PODS:
- apptentive-ios (5.0.0)
- apptentive-ios (5.0.1)

DEPENDENCIES:
- apptentive-ios (from `..`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: ..

SPEC CHECKSUMS:
apptentive-ios: f473d64b41e3c28a1f5824399f38f0f037303066
apptentive-ios: bfaa33a5bd2f345d697038bf81f46b3010642f26

PODFILE CHECKSUM: fb7822acbd17e9b6c60d2db75808647cc370b6a0

Expand Down
2 changes: 1 addition & 1 deletion apptentive-ios.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'apptentive-ios'
s.module_name = 'Apptentive'
s.version = '5.0.0'
s.version = '5.0.1'
s.license = 'BSD'
s.summary = 'Apptentive Customer Communications SDK.'
s.homepage = 'https://www.apptentive.com/'
Expand Down

0 comments on commit 62abfb5

Please sign in to comment.