sugarcube 1.4.6 → 1.5.0
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 +1 -1
- data/lib/sugarcube-repl/object.rb +3 -0
- data/lib/sugarcube/adjust.rb +21 -0
- data/lib/sugarcube/version.rb +1 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/lib/sugarcube/adjust.rb
CHANGED
@@ -244,6 +244,27 @@ module SugarCube
|
|
244
244
|
end
|
245
245
|
alias h shadow
|
246
246
|
|
247
|
+
def blink(color = UIColor.redColor)
|
248
|
+
raise "no view has been assigned to SugarCube::Adjust::adjust" unless $sugarcube_view
|
249
|
+
|
250
|
+
blinking_view = UIView.alloc.initWithFrame([[0,0],$sugarcube_view.frame.size])
|
251
|
+
color = color.uicolor if color.respond_to?(:uicolor)
|
252
|
+
blinking_view.backgroundColor = color
|
253
|
+
if $sugarcube_view.window
|
254
|
+
blinking_view.frame = $sugarcube_view.convertRect([[0, 0], $sugarcube_view.bounds.size], toView: $sugarcube_view.window)
|
255
|
+
$sugarcube_view.window.addSubview(blinking_view)
|
256
|
+
else
|
257
|
+
$sugarcube_view.addSubview(blinking_view)
|
258
|
+
end
|
259
|
+
UIView.animateWithDuration(0.2, animations: ->{ blinking_view.alpha = 0 }, completion: ->(finished) do
|
260
|
+
UIView.animateWithDuration(0.2, animations: ->{ blinking_view.alpha = 1 }, completion: ->(finished) do
|
261
|
+
UIView.animateWithDuration(0.2, animations: ->{ blinking_view.alpha = 0 }, completion: ->(finished) do
|
262
|
+
blinking_view.removeFromSuperview
|
263
|
+
end)
|
264
|
+
end)
|
265
|
+
end)
|
266
|
+
end
|
267
|
+
|
247
268
|
# @param item this can be a tree-like item (UIView, UIViewController,
|
248
269
|
# CALayer) or an integer, in which case it will select that window from
|
249
270
|
# UIApplication.sharedApplication.window. Defalt is to display the
|
data/lib/sugarcube/version.rb
CHANGED