Skip to content

Commit

Permalink
Added VoiceOver to demo apps
Browse files Browse the repository at this point in the history
  • Loading branch information
LowKostKustomz committed Feb 11, 2018
1 parent 8f5b430 commit 8e94163
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Example/StatusAlertDemoObjectiveC/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ - (void)showStatusAlertWithImageNamed:(NSString*)imageName title:(NSString*)titl
title:title
message:message
canBePickedOrDismissed:isPickable];
if (title) {
if (message) {
statusAlert.accessibilityAnnouncement = [[title stringByAppendingString:@", "] stringByAppendingString:message]
} else {
statusAlert.accessibilityAnnouncement = title
}
} else if (message) {
statusAlert.accessibilityAnnouncement = message
}

[statusAlert showInView:self.view withVerticalPosition:preferredVerticalPosition];
}

Expand Down
11 changes: 11 additions & 0 deletions Example/StatusAlertDemoSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ class ViewController: UIViewController {
title: title,
message: message,
canBePickedOrDismissed: isPickable)
statusAlert.accessibilityAnnouncement = {
if let title = title {
if let message = message {
return [title, ", ", message].joined()
}
return title
} else if let message = message {
return message
}
return nil
}()
statusAlert.show(withVerticalPosition: preferredPosition)
}

Expand Down

0 comments on commit 8e94163

Please sign in to comment.