simple-view 0.6.2 → 0.6.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/lib/simple_view/version.rb +1 -1
- data/lib/simple_view/view_builder.rb +1 -0
- data/spec/view_builder_spec.rb +9 -0
- metadata +1 -1
data/lib/simple_view/version.rb
CHANGED
@@ -141,6 +141,7 @@ module SimpleView
|
|
141
141
|
elsif key.end_with?('Image') || key.end_with?('image')
|
142
142
|
view.setValue value.to_image, forKey: key
|
143
143
|
elsif key == 'layer'
|
144
|
+
convert_primitives_to_objects_in_hash value
|
144
145
|
view.layer.setValuesForKeysWithDictionary value
|
145
146
|
else
|
146
147
|
view.setValue value, forKey: key
|
data/spec/view_builder_spec.rb
CHANGED
@@ -36,6 +36,15 @@ describe "SimpleView::ViewBuilder" do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
describe "#layer" do
|
40
|
+
it "should set layer attributes" do
|
41
|
+
view = SimpleView::ViewBuilder.view_for(UIView, layer: {borderWidth: 12, shadowOffset: CGSizeMake(2, 4)})
|
42
|
+
view.layer.borderWidth.should == 12
|
43
|
+
view.layer.shadowOffset.width.should == 2
|
44
|
+
view.layer.shadowOffset.height.should == 4
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
39
48
|
describe "#backgroundColor" do
|
40
49
|
it "should set backgroundColor by HTML code" do
|
41
50
|
view = SimpleView::ViewBuilder.view_for(UIView, backgroundColor: "#f00")
|