Thank you for reading the Dispatch

I enjoy writing the Dispatch, but that wouldn’t matter without you, the reader, using some of your limited time to read it. Thank you.

In the “Poll of the Week” below, I ask what parts of the Dispatch you like, I’d appreciate it if you would let me know.

Do you want write a section as a “guest writer”? Email me: todd@infinitered.com

Happy coding, Todd Werth (@twerth)

Articles, News, and Blog Posts


Jan 19th, 2014 – “Learn to make an app in RubyMotion that uses the camera, you could do this right now” by Jack Watson-Hamblin

Jan 17th, 2014 – “Breaking Cyclical References in RubyMotion with Proc#weak” by Justin DeWind

Jan 16th, 2014 – “Motion Meetup #8 w/ Mark Rickert” by Gant Laborde

Jan 14th, 2014 – “Your Views Have Come To Life” by Jack Watson-Hamblin

Jan 13th, 2014 – “Core Data with NSFetchedResultsController in RubyMotion” by Lori Olson

Poll of the Week


Which sections of the Dispatch do you like?

This week I’m doing a bit of market research, asking you what sections you like in the Dispatch. Let me know if you’d like another section (todd@infinitered.com).

Last week’s poll, “OS X, iOS, or both?”:

  • I build for iOS now –  18 votes (46%)
  • I want to build for OS X in the future – 12 votes (31%)
  • I build for OS X now –  5 votes (13%)
  • I want to build for iOS in the future – 4 votes (10%)

RubyMotion App of the Week


Screenmailer – “Record screen and voice. Share video link via email”

This is a cool app, a reader (Jonas Bruun Nielsen) suggested it for this week’s “App of the Week”. I personally want to try some OS X apps, I wonder how hard it would be to convert RMQ to OS X and NSViews.

RubyMotion Tip – by Mark Rickert


 

awesome_print_motion:

Use the awesome_print_motion gem instead of puts to get auto-formatted & colored output in the console. It detects the object type and makes it much easier to read than a simple “puts”.

After installing, use the ap command:
ap my_cool_hash

RMQ Tip


What is RubyMotionQuery (RMQ) you ask? Check out  this site

Traversing (or moving around the tree)

You can easily move around the tree with RMQ. There is a lot to traversing, but I’ll show you the five most common methods.

view_controller – this simple returns the current view_controller. This is used often.
rmq.view_controller

root_view – this returns the view controller’s root view.
rmq.root_view
which is exactly the same as
rmq.view_controller.view

closest – moves up the tree returning the first view it finds that matches the selectors. Think of this as searching through the view’s ancestors, starting with its parent, then grandparent, etc. Returns one or none, not many.
rmq(self).closest(:section).hide

find – returns all children, grandchildren, great grandchildren, etc, that match the selector. This example disables all buttons and styles them as disabled inside a view that contains them:
rmq(some_view).find(UIButton).disable.apply_style(:disabled_button)

parent – returns the view’s parent.
rmq(foo).parent

One more thing


The rumor is that RubyMotion #inspect 2014 will be announced very soon. It’s going to be a great line-up and the location makes a lot of sense; stay tuned for more details.