sugarcube 0.20.6 → 0.20.7
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/.travis.yml +2 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +16 -0
- data/README.md +5 -3
- data/lib/sugarcube/modal.rb +4 -4
- data/lib/sugarcube/symbol/symbol_uicolor.rb +3 -0
- data/lib/sugarcube/symbol.rb +2 -2
- data/lib/sugarcube/to_s/nsnotification.rb +14 -0
- data/lib/sugarcube/version.rb +1 -1
- data/lib/sugarcube-attributedstring/nsattributedstring.rb +5 -5
- metadata +6 -3
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/README.md
CHANGED
@@ -3,6 +3,8 @@ SugarCube
|
|
3
3
|
|
4
4
|
Some sugar for your cocoa, or your [tea][sweettea].
|
5
5
|
|
6
|
+
[](https://travis-ci.org/rubymotion/sugarcube)
|
7
|
+
|
6
8
|
About
|
7
9
|
-----
|
8
10
|
|
@@ -991,13 +993,13 @@ verbs and SugarCube symbols.
|
|
991
993
|
button = UIButton.alloc.initWithFrame([0, 0, 10, 10])
|
992
994
|
|
993
995
|
button.on(:touch) { my_code }
|
994
|
-
button.on(:
|
996
|
+
button.on(:touch_up_outside, :touch_cancel) { |event|
|
995
997
|
puts event.inspect
|
996
998
|
# my_code...
|
997
999
|
}
|
998
1000
|
|
999
1001
|
# remove handlers
|
1000
|
-
button.off(:touch, :
|
1002
|
+
button.off(:touch, :touch_up_outside, :touch_cancel)
|
1001
1003
|
button.off(:all)
|
1002
1004
|
```
|
1003
1005
|
|
@@ -1570,7 +1572,7 @@ You can analyze `UIViewController` hierarchies, too. There's even a handy
|
|
1570
1572
|
3: | `-- #<ScheduleCalendarController:0x131bba90>
|
1571
1573
|
4: +-- #<CameraViewController:0x13191380>
|
1572
1574
|
5: +-- #<UINavigationController:0xac01ea0>
|
1573
|
-
6: | `-- #<
|
1575
|
+
6: | `-- #<UITableViewController:0xac04e30>
|
1574
1576
|
7: +-- #<PicturesViewController:0x1403ede0>
|
1575
1577
|
8: `-- #<MessagesViewController:0x131a1bc0>
|
1576
1578
|
=> #<MainScreenController:0xac23b80>
|
data/lib/sugarcube/modal.rb
CHANGED
@@ -2,7 +2,7 @@ module SugarCube
|
|
2
2
|
module Modal
|
3
3
|
module_function
|
4
4
|
def present_modal(view_ctlr, options={}, &block)
|
5
|
-
target = options
|
5
|
+
target = options[:target] || UIApplication.sharedApplication.keyWindow.rootViewController
|
6
6
|
animated = options.fetch(:animated, true)
|
7
7
|
target.presentViewController(view_ctlr, animated:animated, completion:block)
|
8
8
|
end
|
@@ -27,17 +27,17 @@ class UIViewController
|
|
27
27
|
|
28
28
|
def present_modal(view_ctlr, options={}, &block)
|
29
29
|
options = options.merge(target: self)
|
30
|
-
|
30
|
+
SugarCube::Modal.present_modal(view_ctlr, options, &block)
|
31
31
|
end
|
32
32
|
|
33
33
|
def present_modal_in_nav(view_ctlr, options={}, &block)
|
34
34
|
options = options.merge(target: self)
|
35
|
-
|
35
|
+
SugarCube::Modal.present_modal_in_nav(view_ctlr, options, &block)
|
36
36
|
end
|
37
37
|
|
38
38
|
def dismiss_modal(view_ctlr, options={}, &block)
|
39
39
|
options = options.merge(target: self)
|
40
|
-
|
40
|
+
SugarCube::Modal.dismiss_modal(view_ctlr, options, &block)
|
41
41
|
end
|
42
42
|
|
43
43
|
end
|
data/lib/sugarcube/symbol.rb
CHANGED
@@ -600,10 +600,10 @@ class Symbol
|
|
600
600
|
end
|
601
601
|
alias uitableviewcellstyle uitablecellstyle
|
602
602
|
|
603
|
-
def
|
603
|
+
def uitableviewcellaccessorytype
|
604
604
|
sugarcube_look_in(Symbol.tableview_cellaccessorytype)
|
605
605
|
end
|
606
|
-
alias uitableviewcellaccessorytype
|
606
|
+
alias uitablecellaccessory uitableviewcellaccessorytype
|
607
607
|
|
608
608
|
def uitablecellselectionstyle
|
609
609
|
sugarcube_look_in(Symbol.tableview_cellselectionstyle)
|
data/lib/sugarcube/version.rb
CHANGED
@@ -122,7 +122,7 @@ class NSAttributedString
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def foreground_color(value)
|
125
|
-
with_attributes({NSForegroundColorAttributeName => value})
|
125
|
+
with_attributes({NSForegroundColorAttributeName => value.uicolor})
|
126
126
|
end
|
127
127
|
alias color foreground_color
|
128
128
|
|
@@ -135,7 +135,7 @@ class NSAttributedString
|
|
135
135
|
end
|
136
136
|
|
137
137
|
def background_color(value)
|
138
|
-
with_attributes({NSBackgroundColorAttributeName => value})
|
138
|
+
with_attributes({NSBackgroundColorAttributeName => value.uicolor})
|
139
139
|
end
|
140
140
|
alias bg_color background_color
|
141
141
|
|
@@ -164,11 +164,11 @@ class NSAttributedString
|
|
164
164
|
end
|
165
165
|
|
166
166
|
def stroke_color(value)
|
167
|
-
with_attributes({NSStrokeColorAttributeName => value})
|
167
|
+
with_attributes({NSStrokeColorAttributeName => value.uicolor})
|
168
168
|
end
|
169
169
|
|
170
170
|
def underline_color(value)
|
171
|
-
with_attributes({NSUnderlineColorAttributeName => value})
|
171
|
+
with_attributes({NSUnderlineColorAttributeName => value.uicolor})
|
172
172
|
end
|
173
173
|
|
174
174
|
def strikethrough_style(value)
|
@@ -176,7 +176,7 @@ class NSAttributedString
|
|
176
176
|
end
|
177
177
|
|
178
178
|
def strikethrough_color(value)
|
179
|
-
with_attributes({NSStrikethroughColorAttributeName => value})
|
179
|
+
with_attributes({NSStrikethroughColorAttributeName => value.uicolor})
|
180
180
|
end
|
181
181
|
|
182
182
|
def shadow(value)
|
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: 0.20.
|
4
|
+
version: 0.20.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-04-
|
16
|
+
date: 2013-04-13 00:00:00.000000000 Z
|
17
17
|
dependencies: []
|
18
18
|
description: ! '== Description
|
19
19
|
|
@@ -43,7 +43,10 @@ extensions: []
|
|
43
43
|
extra_rdoc_files: []
|
44
44
|
files:
|
45
45
|
- .gitignore
|
46
|
+
- .travis.yml
|
46
47
|
- .yardopts
|
48
|
+
- Gemfile
|
49
|
+
- Gemfile.lock
|
47
50
|
- LICENSE
|
48
51
|
- README.md
|
49
52
|
- Rakefile
|
@@ -91,6 +94,7 @@ files:
|
|
91
94
|
- lib/sugarcube/timer.rb
|
92
95
|
- lib/sugarcube/to_s/nserror.rb
|
93
96
|
- lib/sugarcube/to_s/nslayoutconstraint.rb
|
97
|
+
- lib/sugarcube/to_s/nsnotification.rb
|
94
98
|
- lib/sugarcube/to_s/nsset.rb
|
95
99
|
- lib/sugarcube/to_s/nsurl.rb
|
96
100
|
- lib/sugarcube/to_s/uicolor.rb
|
@@ -229,4 +233,3 @@ test_files:
|
|
229
233
|
- spec/uiview_spec.rb
|
230
234
|
- spec/uiviewcontroller_spec.rb
|
231
235
|
- spec/unholy_spec.rb
|
232
|
-
has_rdoc:
|