motion-stylez 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/app/controllers/my_controller.rb +9 -2
- data/lib/motion-stylez/ext.rb +6 -2
- data/lib/motion-stylez/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7adeb8a4e78398e355f82e73e2a4836faafc727b
|
4
|
+
data.tar.gz: 74a11290ba45c6871375d84c29ff7f4f042647c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 409cc331153fcd494cd611d1e672d73e36e340eb9e3dfd3e10fb3d40bb84c568fa299fa7c7065b159290a9fcbc520a28c5579f7d138a9eb1716b25e78553fcd9
|
7
|
+
data.tar.gz: d4c43cc76f93db93b02b7f7fbc26032c6710c89807eb482ff3600d47fb46dbdeb46519ccbdb33c0067604fa0ee9b919fbd1d30d5be71344e6519068216269d9d
|
data/README.md
CHANGED
@@ -53,11 +53,18 @@ class MyViewController < UIViewController
|
|
53
53
|
|
54
54
|
z.stylesheet = MyStylesheet.new # works absolutely anywhere
|
55
55
|
|
56
|
-
z(self.view
|
56
|
+
z(self.view, :white_bg)
|
57
57
|
|
58
|
-
self.view.addSubview(z(UILabel
|
58
|
+
self.view.addSubview(z(UILabel, :bw_big) do |v|
|
59
59
|
v.text = "Testing"
|
60
60
|
end)
|
61
|
+
|
62
|
+
# OR YOU CAN DO THE LONG WAY
|
63
|
+
# z(self.view).style(:white_bg)
|
64
|
+
#
|
65
|
+
# self.view.addSubview(z(UILabel).style(:bw_big) do |v|
|
66
|
+
# v.text = "Testing"
|
67
|
+
# end)
|
61
68
|
|
62
69
|
end
|
63
70
|
end
|
@@ -4,11 +4,18 @@ class MyViewController < UIViewController
|
|
4
4
|
|
5
5
|
z.stylesheet = MyStylesheet.new # works absolutely anywhere
|
6
6
|
|
7
|
-
z(self.view
|
7
|
+
z(self.view, :white_bg)
|
8
8
|
|
9
|
-
self.view.addSubview(z(UILabel
|
9
|
+
self.view.addSubview(z(UILabel, :bw_big) do |v|
|
10
10
|
v.text = "Testing"
|
11
11
|
end)
|
12
|
+
|
13
|
+
# OR YOU CAN DO THE LONG WAY
|
14
|
+
# z(self.view).style(:white_bg)
|
15
|
+
#
|
16
|
+
# self.view.addSubview(z(UILabel).style(:bw_big) do |v|
|
17
|
+
# v.text = "Testing"
|
18
|
+
# end)
|
12
19
|
|
13
20
|
end
|
14
21
|
end
|
data/lib/motion-stylez/ext.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
class Object
|
2
|
-
def z(selector = nil)
|
2
|
+
def z(selector = nil, style = nil, &block)
|
3
3
|
MotionStylez::Base.shared.selector = selector
|
4
|
-
|
4
|
+
if selector && style
|
5
|
+
MotionStylez::Base.shared.style(style, &block)
|
6
|
+
else
|
7
|
+
MotionStylez::Base.shared
|
8
|
+
end
|
5
9
|
end
|
6
10
|
end
|