swipe_action_cell 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
data/lib/swipe_action_cell.rb
CHANGED
@@ -4,6 +4,7 @@ if defined?(Motion::Project::Config)
|
|
4
4
|
Motion::Project::App.setup do |app|
|
5
5
|
app.files.unshift File.join(File.dirname(__FILE__), 'swipe_action_cell/cell.rb')
|
6
6
|
app.files.unshift File.join(File.dirname(__FILE__), 'swipe_action_cell/ui_color.rb')
|
7
|
+
app.files.unshift File.join(File.dirname(__FILE__), 'swipe_action_cell/untoucheble_scroll_view.rb')
|
7
8
|
end
|
8
9
|
end
|
9
10
|
|
@@ -25,13 +25,10 @@ class SwipeActionCell < UITableViewCell
|
|
25
25
|
@leftImageView = UIImageView.alloc.initWithFrame(CGRectZero)
|
26
26
|
@rightImageView = UIImageView.alloc.initWithFrame(CGRectZero)
|
27
27
|
|
28
|
-
@
|
29
|
-
|
30
|
-
@scrollView = UIScrollView.alloc.initWithFrame(CGRectZero).tap do |v|
|
28
|
+
@scrollView = UntouchebleScrollView.alloc.initWithFrame(CGRectZero).tap do |v|
|
31
29
|
v.showsHorizontalScrollIndicator = false
|
32
30
|
v.delegate = self
|
33
|
-
|
34
|
-
v.addGestureRecognizer @singleTap
|
31
|
+
v.targetView = contentView
|
35
32
|
|
36
33
|
v.addSubview @leftImageView
|
37
34
|
v.addSubview @rightImageView
|
@@ -43,11 +40,6 @@ class SwipeActionCell < UITableViewCell
|
|
43
40
|
self
|
44
41
|
end
|
45
42
|
|
46
|
-
def singleTap
|
47
|
-
self.selected = !self.isSelected
|
48
|
-
delegate.cellSelected(self) if delegate.respond_to?(:cellSelected)
|
49
|
-
end
|
50
|
-
|
51
43
|
def leftImage= image
|
52
44
|
@leftImageView.image = image
|
53
45
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class UntouchebleScrollView < UIScrollView
|
2
|
+
|
3
|
+
attr_accessor :targetView
|
4
|
+
|
5
|
+
def touchesBegan touches, withEvent: event
|
6
|
+
targetView.touchesBegan touches, withEvent: event
|
7
|
+
end
|
8
|
+
|
9
|
+
def touchesMoved touches, withEvent: event
|
10
|
+
targetView.touchesMoved touches, withEvent: event
|
11
|
+
end
|
12
|
+
|
13
|
+
def touchesEnded touches, withEvent: event
|
14
|
+
targetView.touchesEnded touches, withEvent: event
|
15
|
+
end
|
16
|
+
|
17
|
+
def touchesCancelled touches, withEvent: event
|
18
|
+
targetView.touchesCancelled touches, withEvent: event
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swipe_action_cell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- lib/swipe_action_cell.rb
|
44
44
|
- lib/swipe_action_cell/cell.rb
|
45
45
|
- lib/swipe_action_cell/ui_color.rb
|
46
|
+
- lib/swipe_action_cell/untoucheble_scroll_view.rb
|
46
47
|
- lib/swipe_action_cell/version.rb
|
47
48
|
- spec/spec_helper.rb
|
48
49
|
- spec/swipe_action_cell_spec.rb
|
@@ -62,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
63
|
version: '0'
|
63
64
|
segments:
|
64
65
|
- 0
|
65
|
-
hash:
|
66
|
+
hash: 3809304758188526184
|
66
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
68
|
none: false
|
68
69
|
requirements:
|
@@ -71,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
72
|
version: '0'
|
72
73
|
segments:
|
73
74
|
- 0
|
74
|
-
hash:
|
75
|
+
hash: 3809304758188526184
|
75
76
|
requirements: []
|
76
77
|
rubyforge_project:
|
77
78
|
rubygems_version: 1.8.24
|