pm_swipe_cells 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/pm_swipe_cells/pm_table_screen.rb +1 -0
- data/lib/pm_swipe_cells/swipeable_cell.rb +12 -4
- data/lib/version/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6af2793f8ba8f9104b974238ec6ad2c49764f2e
|
4
|
+
data.tar.gz: 78728e25f973e126f9b67daa9eef03bcac8a28e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6011fe8d6f3b4c1dfbcec3b21c502799199dca8f7175035911ca9cfe9ccff65dd51745a6ca8f3c5282576c4b205bc8c5ec791d6354f39a436c0c94294a9f1a8
|
7
|
+
data.tar.gz: f1e44f12e375ddac5fd2e60d086fb55a9e55faebefb8a3072c9d0f6bcfdbaef4e5484799d70d12e830c7aff0a697bb26672c1d3d715a446622382cd163717ded
|
data/README.md
CHANGED
@@ -59,6 +59,8 @@ Each array takes up to 4 parameters, one of which is required:
|
|
59
59
|
+ *color*: A UIColor for the button's background (defaults to UIColor.blueColor).
|
60
60
|
|
61
61
|
+ *title*: The text displayed on the button (defaults to the action name).
|
62
|
+
|
63
|
+
+ *icon*: An UIImage used as an icon in place of a title.
|
62
64
|
|
63
65
|
- **Optional**
|
64
66
|
|
@@ -7,6 +7,7 @@ module ProMotion
|
|
7
7
|
|
8
8
|
cell.setDelegate((data[:delegate].nil? ? self : data[:delegate])) if cell.respond_to?(:"setDelegate:")
|
9
9
|
if data[:properties]
|
10
|
+
data[:properties].reject{|k,v| [:right_buttons, :left_buttons].include?(k)}.each {|k,v| cell.send("#{k}=", v) if cell.respond_to?("#{k}=")}
|
10
11
|
cell.config(right_buttons: data[:properties][:right_buttons], left_buttons: data[:properties][:left_buttons]) if cell.respond_to?(:config)
|
11
12
|
end
|
12
13
|
end
|
@@ -6,9 +6,13 @@ class SwipeableCell < SWTableViewCell
|
|
6
6
|
def add_right_buttons(cells_to_add = {})
|
7
7
|
@right_buttons_array = Array.new
|
8
8
|
cells_to_add.each do |opts|
|
9
|
-
opts[:title] ||= opts[:action].to_s
|
10
9
|
opts[:color] ||= UIColor.blueColor
|
11
|
-
|
10
|
+
if opts[:icon] # Must be a UIImage
|
11
|
+
@right_buttons_array.sw_addUtilityButtonWithColor(opts[:color], icon: opts[:icon])
|
12
|
+
else
|
13
|
+
opts[:title] ||= opts[:action].to_s
|
14
|
+
@right_buttons_array.sw_addUtilityButtonWithColor(opts[:color], title: opts[:title].to_s.capitalize)
|
15
|
+
end
|
12
16
|
end
|
13
17
|
@right_buttons_array
|
14
18
|
end
|
@@ -16,9 +20,13 @@ class SwipeableCell < SWTableViewCell
|
|
16
20
|
def add_left_buttons(cells_to_add = {})
|
17
21
|
@left_buttons_array = Array.new
|
18
22
|
cells_to_add.each do |opts|
|
19
|
-
opts[:title] ||= opts[:action].to_s
|
20
23
|
opts[:color] ||= UIColor.blueColor
|
21
|
-
|
24
|
+
if opts[:icon] # Must be a UIImage
|
25
|
+
@left_buttons_array.sw_addUtilityButtonWithColor(opts[:color], icon: opts[:icon])
|
26
|
+
else
|
27
|
+
opts[:title] ||= opts[:action].to_s
|
28
|
+
@left_buttons_array.sw_addUtilityButtonWithColor(opts[:color], title: opts[:title].to_s.capitalize)
|
29
|
+
end
|
22
30
|
end
|
23
31
|
@left_buttons_array
|
24
32
|
end
|
data/lib/version/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pm_swipe_cells
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Egan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ProMotion
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.4.
|
129
|
+
rubygems_version: 2.4.8
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Add customizable swipe actions to ProMotion table cells
|