Class: UIActionSheet

Inherits:
Object show all
Defined in:
lib/formotion/patch/ui_action_sheet.rb

Overview

To make accessibility labels work in UIActionSheets adapted from gist.github.com/953326

Instance Method Summary collapse

Instance Method Details

#addButtonWithTitle(title) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/formotion/patch/ui_action_sheet.rb', line 8

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

#old_addButtonWithTitleObject



6
# File 'lib/formotion/patch/ui_action_sheet.rb', line 6

alias_method :old_addButtonWithTitle, :addButtonWithTitle