Skip to content

Instantly share code, notes, and snippets.

@mecid
Last active January 4, 2019 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mecid/a1a74e8ee0c7226f728d20e3e4b0d001 to your computer and use it in GitHub Desktop.
Save mecid/a1a74e8ee0c7226f728d20e3e4b0d001 to your computer and use it in GitHub Desktop.
saccessibility2.swift
class PresentationCell: UITableViewCell {
var viewModel: PresentationViewModel? {
didSet {
accessibilityLabel = viewModel?.label
accessibilityValue = viewModel?.value
}
}
override func awakeFromNib() {
super.awakeFromNib()
isAccessibilityElement = true
accessibilityTraits = .button
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment