Skip to content

Instantly share code, notes, and snippets.

@mecid
Last active July 9, 2018 10:12
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/a93417e4adbb5f27aff1a457bf46571a to your computer and use it in GitHub Desktop.
Save mecid/a93417e4adbb5f27aff1a457bf46571a to your computer and use it in GitHub Desktop.
accessibility2
let elements = statistics.enumerated().map {
let frame = CGRect(x: 0, y: CGFloat($0 * Layout.barHeight), width: bounds.width, height: Layout.barHeight)
let element = UIAccessibilityElement(accessibilityContainer: self)
element.accessibilityLabel = $1.time
element.accessibilityValue = "\(Int($1.value)), \($1.status)"
element.accessibilityFrameInContainerSpace = frame
return element
}
self.accessibilityElements = elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment