Class: UIBarButtonItem
- Defined in:
- lib/ios/sugarcube-factories/uibarbuttonitem.rb
Overview
Factory methods for UIBarButtonItem
Class Method Summary collapse
- .action(&action) ⇒ Object
- .add(&action) ⇒ Object
- .bookmarks(&action) ⇒ Object
- .camera(&action) ⇒ Object
- .cancel(&action) ⇒ Object
- .compose(&action) ⇒ Object
- .done(&action) ⇒ Object
- .edit(&action) ⇒ Object
- .fast_forward(&action) ⇒ Object
-
.fastforward(&action) ⇒ Object
deprecated.
- .fixed_space(&action) ⇒ Object
-
.fixedspace(&action) ⇒ Object
deprecated.
- .flexible_space(&action) ⇒ Object
-
.flexiblespace(&action) ⇒ Object
deprecated.
- .imaged(image, style = UIBarButtonItemStyleBordered, &action) ⇒ Object
- .organize(&action) ⇒ Object
- .page_curl(&action) ⇒ Object
-
.pagecurl(&action) ⇒ Object
deprecated.
- .pause(&action) ⇒ Object
- .play(&action) ⇒ Object
- .redo(&action) ⇒ Object
- .refresh(&action) ⇒ Object
- .reply(&action) ⇒ Object
- .rewind(&action) ⇒ Object
- .save(&action) ⇒ Object
- .search(&action) ⇒ Object
- .stop(&action) ⇒ Object
- .titled(title, style = UIBarButtonItemStyleBordered, &action) ⇒ Object
- .trash(&action) ⇒ Object
- .undo(&action) ⇒ Object
Instance Method Summary collapse
-
#set_target_and_action(target, action) ⇒ Object
Adds the action and keeps a strong reference to the Proc object.
Class Method Details
.action(&action) ⇒ Object
52 53 54 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 52 def action(&action) (UIBarButtonSystemItemAction, action) end |
.add(&action) ⇒ Object
22 23 24 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 22 def add(&action) (UIBarButtonSystemItemAdd, action) end |
.bookmarks(&action) ⇒ Object
60 61 62 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 60 def bookmarks(&action) (UIBarButtonSystemItemBookmarks, action) end |
.camera(&action) ⇒ Object
76 77 78 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 76 def camera(&action) (UIBarButtonSystemItemCamera, action) end |
.cancel(&action) ⇒ Object
10 11 12 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 10 def cancel(&action) (UIBarButtonSystemItemCancel, action) end |
.compose(&action) ⇒ Object
44 45 46 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 44 def compose(&action) (UIBarButtonSystemItemCompose, action) end |
.done(&action) ⇒ Object
6 7 8 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 6 def done(&action) (UIBarButtonSystemItemDone, action) end |
.edit(&action) ⇒ Object
14 15 16 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 14 def edit(&action) (UIBarButtonSystemItemEdit, action) end |
.fast_forward(&action) ⇒ Object
101 102 103 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 101 def fast_forward(&action) (UIBarButtonSystemItemFastForward, action) end |
.fastforward(&action) ⇒ Object
deprecated
97 98 99 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 97 def fastforward(&action) (UIBarButtonSystemItemFastForward, action) end |
.fixed_space(&action) ⇒ Object
40 41 42 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 40 def fixed_space(&action) (UIBarButtonSystemItemFixedSpace, action) end |
.fixedspace(&action) ⇒ Object
deprecated
36 37 38 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 36 def fixedspace(&action) (UIBarButtonSystemItemFixedSpace, action) end |
.flexible_space(&action) ⇒ Object
31 32 33 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 31 def flexible_space(&action) (UIBarButtonSystemItemFlexibleSpace, action) end |
.flexiblespace(&action) ⇒ Object
deprecated
27 28 29 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 27 def flexiblespace(&action) (UIBarButtonSystemItemFlexibleSpace, action) end |
.imaged(image, style = UIBarButtonItemStyleBordered, &action) ⇒ Object
126 127 128 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 126 def imaged(image, style = UIBarButtonItemStyleBordered, &action) (image, style, action) end |
.organize(&action) ⇒ Object
56 57 58 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 56 def organize(&action) (UIBarButtonSystemItemOrganize, action) end |
.page_curl(&action) ⇒ Object
118 119 120 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 118 def page_curl(&action) (UIBarButtonSystemItemPageCurl, action) end |
.pagecurl(&action) ⇒ Object
deprecated
114 115 116 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 114 def pagecurl(&action) (UIBarButtonSystemItemPageCurl, action) end |
.pause(&action) ⇒ Object
88 89 90 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 88 def pause(&action) (UIBarButtonSystemItemPause, action) end |
.play(&action) ⇒ Object
84 85 86 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 84 def play(&action) (UIBarButtonSystemItemPlay, action) end |
.redo(&action) ⇒ Object
109 110 111 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 109 def redo(&action) (UIBarButtonSystemItemRedo, action) end |
.refresh(&action) ⇒ Object
68 69 70 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 68 def refresh(&action) (UIBarButtonSystemItemRefresh, action) end |
.reply(&action) ⇒ Object
48 49 50 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 48 def reply(&action) (UIBarButtonSystemItemReply, action) end |
.rewind(&action) ⇒ Object
92 93 94 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 92 def rewind(&action) (UIBarButtonSystemItemRewind, action) end |
.save(&action) ⇒ Object
18 19 20 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 18 def save(&action) (UIBarButtonSystemItemSave, action) end |
.search(&action) ⇒ Object
64 65 66 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 64 def search(&action) (UIBarButtonSystemItemSearch, action) end |
.stop(&action) ⇒ Object
72 73 74 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 72 def stop(&action) (UIBarButtonSystemItemStop, action) end |
.titled(title, style = UIBarButtonItemStyleBordered, &action) ⇒ Object
122 123 124 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 122 def titled(title, style = UIBarButtonItemStyleBordered, &action) (title, style, action) end |
.trash(&action) ⇒ Object
80 81 82 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 80 def trash(&action) (UIBarButtonSystemItemTrash, action) end |
.undo(&action) ⇒ Object
105 106 107 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 105 def undo(&action) (UIBarButtonSystemItemUndo, action) end |
Instance Method Details
#set_target_and_action(target, action) ⇒ Object
Adds the action and keeps a strong reference to the Proc object.
133 134 135 136 137 |
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 133 def set_target_and_action target, action self.target = target self.action = 'sugarcube_handle_action:' @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action end |