mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 17:52:17 +08:00
Fixe .data assigning to UITextView and UITextField in SDK 8.0 (I think it's just 8)
This commit is contained in:
@@ -33,8 +33,8 @@ module RubyMotionQuery
|
||||
#when UIStepper then
|
||||
#when UITabBar then
|
||||
#when UITableViewCell then
|
||||
when UITextView then view.setText new_data
|
||||
when UITextField then view.setText new_data
|
||||
when UITextView then view.text = new_data
|
||||
when UITextField then view.text = new_data
|
||||
#when UINavigationBar then
|
||||
#when UIScrollView then
|
||||
|
||||
@@ -80,7 +80,7 @@ module RubyMotionQuery
|
||||
# @example
|
||||
# rmq(my_view).data = 'some data'
|
||||
def data=(new_data)
|
||||
data(new_data)
|
||||
self.data(new_data)
|
||||
end
|
||||
|
||||
# @return [RMQ]
|
||||
|
||||
@@ -169,4 +169,17 @@ describe 'actions' do
|
||||
# Again, chained
|
||||
q = rmq.create(UILabel).data(nil).get.text.should == nil
|
||||
end
|
||||
|
||||
it 'should allow the user to set data to nil using data =' do
|
||||
q = rmq.create(UITextView)
|
||||
q.data('hi')
|
||||
q.get.text.should == 'hi'
|
||||
|
||||
q.data = nil
|
||||
q.get.text.should == ""
|
||||
|
||||
q = rmq.create(UITextField)
|
||||
q.data('there')
|
||||
q.get.text.should == 'there'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user