Allows you to set a UIView's userInteractionEnabled property.

This commit is contained in:
Mark Rickert
2015-03-18 20:32:41 -04:00
parent 4f91ccd170
commit 690b5a14fb
2 changed files with 19 additions and 0 deletions

View File

@@ -392,6 +392,12 @@ module RubyMotionQuery
end
def shadow_path ; @view.layer.shadowPath ; end
def user_interaction_enabled=(value)
@view.setUserInteractionEnabled(!!value)
end
def user_interaction_enabled
@view.isUserInteractionEnabled
end
# @deprecated - use frame hashs
def left=(value)

View File

@@ -50,6 +50,7 @@ class StyleSheetForUIViewStylerTests < RubyMotionQuery::Stylesheet
st.background_color = color.red
st.tint_color = color.blue
st.corner_radius = 5
st.user_interaction_enabled = false
# Shadows
st.shadow_color = color.gray
@@ -336,6 +337,18 @@ describe 'ui_view_styler' do
@value.should.be.false
end
it "should set user interaction enabled and disabled" do
view = @vc.rmq.append(@view_klass, :ui_view_kitchen_sink).get
view.isUserInteractionEnabled.should == false
rmq(view).style do |st|
st.user_interaction_enabled.should == false
st.user_interaction_enabled = true
st.user_interaction_enabled.should == true
end
end
it "should set shadow values" do
view = @vc.rmq.append(@view_klass, :ui_view_kitchen_sink).get