Sha256: a49d1267f19cf1af37a5f3c2dffa3e2edc61836b78cbbd8806a74b03dbf17c9a
Contents?: true
Size: 684 Bytes
Versions: 18
Compression:
Stored size: 684 Bytes
Contents
# To make accessibility labels work in UIActionSheets # adapted from https://gist.github.com/953326 class UIActionSheet alias_method :old_addButtonWithTitle, :addButtonWithTitle def addButtonWithTitle(title) button_index = old_addButtonWithTitle(title) self.subviews.each { |subview| if subview.respond_to? :title controlTitle = subview.send(:title) if (title == controlTitle) copyAccessibilityMetadataFrom(title, toControl: subview) return button_index end end } button_index end private def copyAccessibilityMetadataFrom(title, toControl:control) control.accessibilityLabel = title end end
Version data entries
18 entries across 18 versions & 1 rubygems