Class: Sharemotion::Sheet
- Inherits:
-
UIActionSheet
- Object
- UIActionSheet
- Sharemotion::Sheet
- Defined in:
- lib/sharemotion/sheet.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#sharers ⇒ Object
readonly
Returns the value of attribute sharers.
-
#title ⇒ Object
writeonly
Sets the attribute title.
Instance Method Summary collapse
- #actionSheet(action_sheet, clickedButtonAtIndex: index) ⇒ Object
- #initWithSharers(sharers, controller: controller) {|_self| ... } ⇒ Object
- #sheet_configuration ⇒ Object
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'lib/sharemotion/sheet.rb', line 6 def controller @controller end |
#sharers ⇒ Object (readonly)
Returns the value of attribute sharers.
6 7 8 |
# File 'lib/sharemotion/sheet.rb', line 6 def sharers @sharers end |
#title=(value) ⇒ Object (writeonly)
Sets the attribute title
5 6 7 |
# File 'lib/sharemotion/sheet.rb', line 5 def title=(value) @title = value end |
Instance Method Details
#actionSheet(action_sheet, clickedButtonAtIndex: index) ⇒ Object
24 25 26 |
# File 'lib/sharemotion/sheet.rb', line 24 def actionSheet(action_sheet, clickedButtonAtIndex:index) @sharers[index].share(@controller) unless self.cancelButtonIndex == index end |
#initWithSharers(sharers, controller: controller) {|_self| ... } ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/sharemotion/sheet.rb', line 8 def initWithSharers(sharers, controller:controller, &block) @sharers, @controller = sharers, controller self.initWithTitle(nil, delegate:self, cancelButtonTitle:nil, destructiveButtonTitle:nil, otherButtonTitles:nil) self.sheet_configuration yield(self) if block_given? self end |
#sheet_configuration ⇒ Object
17 18 19 20 21 22 |
# File 'lib/sharemotion/sheet.rb', line 17 def sheet_configuration @sharers.each { |s| self.addButtonWithTitle(s.sharer_title) } self.cancelButtonIndex = self.addButtonWithTitle( BW.localized_string(:shm_cancel, 'Cancel')) self.title = "Share" end |