Class: UIBarButtonItem

Inherits:
Object show all
Defined in:
lib/ios/sugarcube-factories/uibarbuttonitem.rb

Overview

Factory methods for UIBarButtonItem

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.action(&action) ⇒ Object


52
53
54
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 52

def action(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemAction, action)
end

.add(&action) ⇒ Object


22
23
24
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 22

def add(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemAdd, action)
end

.bookmarks(&action) ⇒ Object


60
61
62
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 60

def bookmarks(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemBookmarks, action)
end

.camera(&action) ⇒ Object


76
77
78
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 76

def camera(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemCamera, action)
end

.cancel(&action) ⇒ Object


10
11
12
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 10

def cancel(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemCancel, action)
end

.compose(&action) ⇒ Object


44
45
46
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 44

def compose(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemCompose, action)
end

.done(&action) ⇒ Object


6
7
8
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 6

def done(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemDone, action)
end

.edit(&action) ⇒ Object


14
15
16
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 14

def edit(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemEdit, action)
end

.fast_forward(&action) ⇒ Object


101
102
103
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 101

def fast_forward(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemFastForward, action)
end

.fastforward(&action) ⇒ Object

deprecated


97
98
99
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 97

def fastforward(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemFastForward, action)
end

.fixed_space(&action) ⇒ Object


40
41
42
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 40

def fixed_space(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemFixedSpace, action)
end

.fixedspace(&action) ⇒ Object

deprecated


36
37
38
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 36

def fixedspace(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemFixedSpace, action)
end

.flexible_space(&action) ⇒ Object


31
32
33
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 31

def flexible_space(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemFlexibleSpace, action)
end

.flexiblespace(&action) ⇒ Object

deprecated


27
28
29
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 27

def flexiblespace(&action)
  sugarcube_barbuttonitem(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)
  sugarcube_barbuttonitem_with_image(image, style, action)
end

.organize(&action) ⇒ Object


56
57
58
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 56

def organize(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemOrganize, action)
end

.page_curl(&action) ⇒ Object


118
119
120
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 118

def page_curl(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemPageCurl, action)
end

.pagecurl(&action) ⇒ Object

deprecated


114
115
116
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 114

def pagecurl(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemPageCurl, action)
end

.pause(&action) ⇒ Object


88
89
90
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 88

def pause(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemPause, action)
end

.play(&action) ⇒ Object


84
85
86
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 84

def play(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemPlay, action)
end

.redo(&action) ⇒ Object


109
110
111
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 109

def redo(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemRedo, action)
end

.refresh(&action) ⇒ Object


68
69
70
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 68

def refresh(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemRefresh, action)
end

.reply(&action) ⇒ Object


48
49
50
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 48

def reply(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemReply, action)
end

.rewind(&action) ⇒ Object


92
93
94
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 92

def rewind(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemRewind, action)
end

.save(&action) ⇒ Object


18
19
20
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 18

def save(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemSave, action)
end

.search(&action) ⇒ Object


64
65
66
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 64

def search(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemSearch, action)
end

.stop(&action) ⇒ Object


72
73
74
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 72

def stop(&action)
  sugarcube_barbuttonitem(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)
  sugarcube_barbuttonitem_with_title(title, style, action)
end

.trash(&action) ⇒ Object


80
81
82
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 80

def trash(&action)
  sugarcube_barbuttonitem(UIBarButtonSystemItemTrash, action)
end

.undo(&action) ⇒ Object


105
106
107
# File 'lib/ios/sugarcube-factories/uibarbuttonitem.rb', line 105

def undo(&action)
  sugarcube_barbuttonitem(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