From d471c7a5f4449a8f0224fcc179ba6ec20dcd0fd9 Mon Sep 17 00:00:00 2001 From: Todd Werth Date: Tue, 2 Dec 2014 14:11:09 -0800 Subject: [PATCH] Added rmq.app.windows that returns the windows array --- motion/ruby_motion_query/app.rb | 8 +++++++- spec/app.rb | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/motion/ruby_motion_query/app.rb b/motion/ruby_motion_query/app.rb index 34c577c..5e04dc7 100644 --- a/motion/ruby_motion_query/app.rb +++ b/motion/ruby_motion_query/app.rb @@ -21,8 +21,14 @@ module RubyMotionQuery end end + def windows + if shared_application = UIApplication.sharedApplication + shared_application.windows + end + end + # @return [UIApplicationDelegate] - def delegate + def delegate UIApplication.sharedApplication.delegate end diff --git a/spec/app.rb b/spec/app.rb index 2e84862..322d0bf 100644 --- a/spec/app.rb +++ b/spec/app.rb @@ -16,6 +16,10 @@ describe 'app' do @app.window.should == UIApplication.sharedApplication.keyWindow end + it 'should return app windows' do + @app.windows.should == UIApplication.sharedApplication.windows + end + it 'should return app delegate' do @app.delegate.should == UIApplication.sharedApplication.delegate end