This file contains hidden or 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
| let greetingLessonView = UIView() | |
| let bcp47LanguageCode = "es-Es" | |
| let translatedPhrase = "¡Buenos días! " | |
| let attributedLabel = NSMutableAttributedString(string: translatedPhrase,attributes: [.accessibilitySpeechLanguage: bcp47LanguageCode]) | |
| attributedLabel.append(NSAttributedString(string: "Means: good morning!")) | |
| greetingLessonView.accessibilityAttributedLabel = attributedLabel |
This file contains hidden or 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
| let liveNewsChannelView = UIView() | |
| let attributedLabel = NSMutableAttributedString(string: "24 hour news channel. ") | |
| attributedLabel.append(NSAttributedString(string: "Live",attributes: [.accessibilitySpeechIPANotation: "laɪv"])) | |
| liveNewsChannelView.accessibilityAttributedLabel = attributedLabel |
This file contains hidden or 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
| if likeButton.isSelected { | |
| accessibilityTraits.insert(.selected) | |
| } else { | |
| accessibilityTraits.remove(.selected) | |
| } |
This file contains hidden or 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
| // Create Custom Actions | |
| let artistCustomAction = UIAccessibilityCustomAction(name: userName) { _ in | |
| self.navigationController?.present(artistViewController, animated: true, completion: nil) | |
| return true | |
| } | |
| let likeCustomAction = UIAccessibilityCustomAction(name: "like") { _ in | |
| likedSongs.append(song) | |
| return true | |
| } |
This file contains hidden or 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
| // Check if the user has Video Autoplay enabled | |
| if UIAccessibility.isVideoAutoplayEnabled { | |
| video.play() | |
| } else { | |
| video.pause() | |
| } |
This file contains hidden or 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
| // Check if the user needs differentiation without color | |
| if UIAccessibility.shouldDifferentiateWithoutColor { | |
| card.colorSymbolImageView.hidden = false | |
| } else { | |
| card.colorSymbolImageView.hidden = true | |
| } |
This file contains hidden or 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
| // Create a Large Content Viewer Interaction | |
| let largeContentViewerInteraction = UILargeContentViewerInteraction() | |
| // Add it to your view | |
| customBarView.addInteraction(largeContentViewerInteraction) | |
| // Enable Large Content Viewer in the buttons or labels you want | |
| customBarTabButton.showsLargeContentViewer = true | |
| // If it is a custom view that you want to enable for Large Content Viewer, |
This file contains hidden or 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
| // Provide input alternatives for Voice Control | |
| settingsButton.accessibilityUserInputLabels = ["settings", "configuration", "cog"] |
NewerOlder