Monthly Archives: January 2014

Issue #12

Now the official RubyMotion newsletter

The Dispatch is now the official newsletter for RubyMotion. What does this mean to you the reader? Good question — not much. Nothing is changing in the Dispatch, I’m still writing it, it’s still a product of my company InfiniteRed. The main difference is: instead of HipByte creating their own newsletter, they are going to direct their customers to the Dispatch instead.

Also, some announcements will be done in the Dispatch rather than in an email from HipByte. Also (that vein on the grammarians’ forehead is now pulsing like the siren of an ambulance, speeding through downtown London) other community efforts, such as Motion Meetup, will make their announcements through the Dispatch.

Continue reading

Issue #11

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.

Issue #10

A lack of RubyMotion news and posts

Ken (@seriousken) and I were talking when I first started the RubyMotion Dispatch. We discussed how it may be hard, because there won’t be enough content to write one every week, the RubyMotion community just wasn’t big enough. Well, this is issue number 10 and a lack of news and blog posts has definitely not been my problem. Even over the holidays there were plenty of posts and I’m sure I miss some every week. It’s good to see the community is vibrant and growing.

Happy coding, Todd Werth (@twerth)

Articles, News, and Blog Posts


Jan 13th, 2014 – “Overriding BubbleWrap Methods” by Mark Rickert

Jan 13th, 2014 – “ERB vs UIView – Requesting Data” by Jack Watson-Hamblin

Jan 12th, 2014 – “A Different Kind of MVC” by Jack Watson-Hamblin

Jan 11th, 2014 – “DOGEPrice – OS X app” by James A. Anderson

Jan 11th, 2014 – “Simple Yelp search using Rubymotion. My First Rubymotion app!” by faizaanshamsi

Jan 10th, 2014 – “MotionSwReveal – A ProMotion gem for SWRevealViewController” by W.R. de Vos

Jan 10th, 2014 – “On learning Ruby Motion versus Objective C & Xcode” by Alasdair Monk

Jan 9th, 2014 – “More Community Members” by Jack Watson-Hamblin

Jan 9th, 2014 – “My Sublime Setup” by Jack Watson-Hamblin

Jan 8th, 2014 – “The Amazing Power of NSCoding” by Jack Watson-Hamblin

Jan 7th, 2014 – “5 Ways To Improve Your RubyMotion Apps Organisation” by Jack Watson-Hamblin

Jan 7th, 2014 – “Renaming Your iOS App” by Mark Rickert

Jan 7th, 2014 – “RubyMotion and 3rd Party Native Frameworks: Vendoring vs Gems” by Ryan Grey

In case you missed it

Automatic screenshots for your RubyMotion apps” by Clay Allsopp

Building native iOS apps using modern technologies with RubyMotion” by Laurent Sansonetti

Poll of the Week


OS X, iOS, or both?

Last week’s poll, “What versions of iOS do you support?”:

  • iOS 7 only –  8 votes (89%)
  • iOS 6 and above – 1 vote (11%)
  • iOS 5 and above – 0 votes (0%)

This was not a popular poll, only 9 votes :-(.

RubyMotion Tip


Puts and NSLog:
You can output to the console with either puts or NSLog, but only NSLog will output to the console on your device, XCode/Organizer/DEVICES/Your device/Console:
puts ‘foo’
NSLog ‘foo’

RMQ Tip


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

Log Tree

A very handy logging tool is RMQ’s tree logging. You can log the entire tree of the controller, or just the tree of a specific UIView. This is for the entire tree:
rmq.log :tree

This is just for the Section view in RMQ’s example app:
rmq(:section).log :tree

Which outputs this:
(main)> rmq(:section).log :tree
─── Section  ( section )  150081248  {l: 25, t: 448, w: 270, h: 110}
├─── UILabel  ( section_title )  150085056  {l: 10, t: 10, w: 150, h: 20}
├─── UISwitch  ( section_enabled )  150091072  {l: 10, t: 30, w: 51, h: 31}
│    ├─── _UISwitchInternalViewN  150092000  {l: 0, t: 0, w: 51, h: 31}
│    │    ├─── UIView  150093184  {l: 35.5, t: 0, w: 15.5, h: 31}
│    │    │    ├─── UIView  150092752  {l: -35.5, t: 0, w: 51, h: 31}
│    │    ├─── UIView  150093040  {l: 0, t: 0, w: 35.5, h: 31}
│    │    │    ├─── UIView  150092896  {l: 0, t: 0, w: 51, h: 31}
│    │    ├─── UIView  150097968  {l: 0, t: 0, w: 51, h: 31}
│    │    │    ├─── UIImageView  150097248  {l: 39, t: 16, w: 0, h: 0}
│    │    │    ├─── UIImageView  150097776  {l: 12, t: 16, w: 0, h: 0}
│    │    ├─── UIImageView  150093600  {l: 7, t: -6, w: 57, h: 43.5}
├─── UIButton  ( start_spinner )  150104224  {l: 10, t: 64, w: 120, h: 40}
│    ├─── UIButtonLabel  150202656  {l: 8, t: 9, w: 104, h: 22}
├─── UIButton  ( stop_spinner )  150108512  {l: 140, t: 64, w: 120, h: 40}
│    ├─── UIButtonLabel  150199280  {l: 8, t: 9, w: 103, h: 22}
=> nil
(main)>

Issue #9

The RubyMotion Community

In the early days of Rails, the community was small and anyone could join the conversation and be included. Over time, as the community scaled (see what I did there?), that conversation turned into broadcasting by the community leaders and the community became an audience. I’m not knocking the Rails community, this is natural when communities get large.

The RubyMotion community is still very small, and we’re all betting that RubyMotion will take off and be a big deal. Now is a great time to join the conversation.

Jack Watson-Hamblin has written a few posts about the community, and is organizing a BaseCamp group to build apps as a community.

Gant Laborde runs Motion Meetup, a monthly video chat about RubyMotion (I’ll be on in February btw).

If you tweet something with “RubyMotion” people will answer you (I look every once and in a while and answer questions). Feel free to send me an email or chat with me on Google Hangouts: todd@infinitered.com. Join Jack’s group. Ask or answer questions on Stackoverflow like Jamon Holmgren does. Keep on working on those gems. Lastly, be good to each other.

Continue reading