sugarcube 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
# changing it to suit my needs, and offering it here
|
4
4
|
class UIView
|
5
5
|
|
6
|
+
sugarcube_cleanup do
|
7
|
+
self.off_gestures
|
8
|
+
end
|
9
|
+
|
6
10
|
# A generic gesture adder, but accepts a block like the other gesture methods
|
7
11
|
# @yield [recognizer] Handles the gesture event, and passes the recognizer instance to the block.
|
8
12
|
# @param options [Hash] method/value pairs to call on the gesture.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class UIViewController
|
2
|
+
|
3
|
+
def sugarcube_cleanup
|
4
|
+
super
|
5
|
+
self.view.sugarcube_cleanup
|
6
|
+
self.childViewControllers.each do |subctlr|
|
7
|
+
subctlr.sugarcube_cleanup
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
class UIResponder
|
15
|
+
|
16
|
+
class << self
|
17
|
+
|
18
|
+
def sugarcube_cleanup(&block)
|
19
|
+
@sugarcube_cleanup ||= []
|
20
|
+
return @sugarcube_cleanup unless block
|
21
|
+
@sugarcube_cleanup << block
|
22
|
+
return nil
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def sugarcube_cleanup
|
28
|
+
self.class.ancestors.each do |klass|
|
29
|
+
next unless klass.respond_to?(:sugarcube_cleanup)
|
30
|
+
klass.sugarcube_cleanup.each do |block|
|
31
|
+
self.instance_eval(&block)
|
32
|
+
end
|
33
|
+
break if klass == UIResponder
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
class UIView
|
41
|
+
|
42
|
+
def sugarcube_cleanup
|
43
|
+
super
|
44
|
+
self.subviews.each do |subview|
|
45
|
+
subview.sugarcube_cleanup
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
data/lib/sugarcube/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugarcube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- lib/sugarcube.rb
|
191
191
|
- lib/sugarcube/adjust.rb
|
192
192
|
- lib/sugarcube/look_in.rb
|
193
|
+
- lib/sugarcube/sugarcube_cleanup.rb
|
193
194
|
- lib/sugarcube/version.rb
|
194
195
|
- resources/Default-568h@2x.png
|
195
196
|
- resources/Default.png
|