When it rains it pours

People in long lines at the Apple stores (my local store), iPhone 6 shipped today (mine is in a FedEx truck out for delivery, please hurry, we’re running out of oxygen), iPhone 6++ and its awesome camera, RubyMotion beta for Android (that is referred to as burying the lead), automatic update to Xcode 6 (thanks Apple for ruining my morning by breaking my builds), iOS 8 rollout, RubyMotion 2.3 released (minor update), Mark Rickert left his lake “house” and now is at a McDonalds in an unknown city (well I know, but you can’t make me talk), We don’t have to change our apps to Euros for Scotland. Did I miss anything?


If you missed the last issue, you can find it here: issue #43.

Happy coding, Todd Werth (@twerth)

RubyMotion News


Public Beta of RubyMotion for Android

image

Read about it here.

A free screencast about setting everything up.

Examples.

RubyMotion 2.33 released

  • Added support for installing pre-releases of RubyMotion. The
    sudo motion update --pre command will install a pre-release build in
    /Library/RubyMotionPre. Currently, the pre-release channel contains
    the first beta of RubyMotion for Android. Enjoy! ^_^

sudo motion update

RubyKaigi 2014 Discount (15% off)

Go here.

Articles, News, New Gems, and Blog Posts


September 23th, 2014 | meetup | by Ruby Ireland Meetup
RubyMotion Ireland – Paul Campbell present an introduction to rapid native iOS app development using Ruby with RubyMotion

September 18th, 2014 | screencast | by Jack Watson-Hamblin
MotionInMotion – Episode 43 – The Raw Experience of Setting Up RubyMotion for Android

September 18th, 2014 | blog post | by Mark Rickert
Prepending the Default RubyMotion Build Task

September 17th, 2014 | slides – Japanese | by Katsuyoshi Ito
CDQ for the first time

September 17th, 2014 | slides | by Sotaro Omura
RubyMotion もくもく会 in Osaka

September 17th, 2014 | blog post – Japanese | by Y.Kentaro
No headers to parse

September 17th, 2014 | interesting tweet | by Ivan Acosta-Rubio
Laurent Introducing Android beta at RubyMotion Kaigi 2014

September 16th, 2014 | blog post | by RubyMotion
Announcing the public Beta of RubyMotion for Android

September 15th, 2014 | screencast | by Jack Watson-Hamblin
MotionInMotion – Episode 42 – Objective-C Basics and Conversion

September 15th, 2014 | new gem | by Qi He
Rubymotion Geocoder wrapper!

RubyMotion App of the Week


image

K2 Poker – by By Stuart Hanscombe

“K2 Poker, become the King of Poker by winning an imaginary $1 Million, starting with just $1 double your way up the mountain of cash by playing everybody’s favorite Poker game, with the added twist of being able to burn your cards along the way. You have been given the advantage, use it wisely.”

Gems used:

  • RMQ => Layout / Stylesheets, event handling, animations.
  • Formotion => settings Page
  • Bubble-Wrap => Sounds
  • Motion-Social => Sharing functionality.

Non RubyMotion gem:

  • Ruby-Poker

Hidden Gem by Gant Laborde


RM Loop Efficiency

We’re all familiar (at least I assume) with ways to loop n times in Ruby.

There’s:

  • The universal for loop for i in 1..n
  • The terse yet readable times loop n.times
  • Finally the witty upto loop 1.upto(n)

Each loop has different readability and implementation speed. Though I’ve always had a proclivity towards n.times do or 1.upto(n), It was my understanding that it’s generally concluded that the ugly for loop wins. After coming across that statement again and realizing how different RubyMotion was from most other implementations, I decided to give it a go.

The Results

To my delight, the results were clearly. for loop in RM is actually the slowest across the board! From 500, to 5 million, and there’s nearly no difference between n.times and 1.upto(n). If I had to give credence to one or the other, it seems upto wins in Normal rake tasks, and times wins with mode set to release.

I’m just happy all results show not to use the ugly for loop.

Try it for yourself!

CDQ Tip of the Week by Gant Laborde


The motion_print gem continues to sprint beyond its dead competitor awesome_print_motion. Besides being smaller and faster, the gem hast started to support detailed printing of common RubyMotion libraries. The new 0.0.3 release can detect and elaborate on the contents of CDQ objects.

https://github.com/MohawkApps/motion_print/pull/7

Sponsor


My company InfiniteRed sponsors this newsletter by allowing me the time to work on it every week and hosting everything.

Contact us if you ever need help working on a project, mentoring, or other development services . We specialize in RubyMotion and have an awesome team.

image


If you have any tips, blog posts, or comments, please send emails to todd@infinitered.com