Before you write it yourself, look here

One of the questions I get asked a lot is where to find gems and other 3rd party code:

Write an article, gem, or something else that I haven’t noticed? Tell me, I may include it next week.

Happy coding, Todd Werth (@twerth)

Articles, News, and Blog Posts


This week

11/23/2013 – “Always Check The Source Code” by Jack Watson-Hamblin

11/23/2013 – “motion-acknowledgements” a gem by Mark Rickert11/23/2013 = “Using RubyMotion to Build Something Useful” by Raymond T. Hightower

11/22/2013 – “Heap Overflow in Floating Point Parsing (CVE-2013-4164)” by tenderlove

11/22/2013 – “How to integrate your RubyMotion OS X app with a JSON based web API” by Elliot Draper

11/21/2013 – “Motion Meetup #7 with Dennis Ushakov” Video hosted by Gant Laborde
Thanks for the shoutout Gant 🙂

11/who knows/2013 – “Going Native With RubyMotion” by Sean Ho and Rachel Laycock

RubyMotion News


 

RubyMotion version 2.16 released

  • Fixed a heap overflow in floating point parsing (CVE-2013-4164).
  • Improved Time#{<, >, ==, eql?} performance. 9 times faster.
  • Improved the performance when NSDate objects are converted to Time objects. 10 times faster.
  • Fixed regression in the REPL that made it impossible to use block local    variables.

RubyMotion version 2.15 released

  • Added support for Xcode 5.1 Developer Preview and iOS 7.1 Beta.
  • Improved REPL to recognize Simulator at any scale and orientation. The only unsupported variant at this time is a Simulator window with scroll bars.
  • Fixed REPL<->Simulator coordinate translation when run on a Retina Mac.
  • Fixed undefined behaviour in REPL such as local variables not being stored.
  • Improved dispatching of shortcut methods (ex foo= is shortcut of setFoo:). 20 times faster.
  • Improved the performance where Fixnum and Float are returned. 20% faster.
  • Improved Array#concat performance. About 2 times faster.
  • Improved Array#reverse performance. 2 times faster.
  • Improved Array#reverse! performance. 8 times faster.
  • Improved Array#rotate performance. 5 times faster.
  • Improved Array#rotate! performance. 40 times faster.
  • Improved iterators performance (ex Array#{each, map}). 2-3 times faster.
  • Fixed a bug where Array#rotate! causes a crash in REPL.
  • Fixed a bug where the objects created by “CFxxxCreate(args)” are not released.
  • Fixed a bug in dispatcher where #super cannot look up the shortcut method. (ie #foo=)
  • Improve the precision of Float value.
  • Raise error if cleaning a build artefact fails.
  • [iOS] Fixed and optimized remote debugging (`rake device debug=1′).
  • [iOS] Fixed a bug where `rake device’ would no longer print the application logs from the device.
  • [OSX] Fixed a bug on OSX platform where compiler flags for iOS are passed when it generates bridgesupport file for vendor library.
  • [OSX] Added missing bridgesupport metadata for Carbon, OSServices and ApplicationServices frameworks.
  • [iOS] Deprecated optional block that can be passed to the `tests` method when making use of the view test helpers. This can be done with normal `before` filters.

>  sudo motion update

RubyMotion App of the Week


Updated 9/21/2013 – Basecamp 
“The official app for Basecamp, the world’s #1 project management app.”

I’ve noticed it uses a lot of UIWebViews instead of native code, so it’s perhaps not a great example of a RubyMotion app. However, it’s probably the most popular RM app in existence.

iOS Control of the Week


Updated 6 days ago – Ask4AppReviews
Language: ObjectiveC
“Ask4AppReviews is a class that you can drop into any iPhone app (iOS 5.0 or later) that will help remind your users to review your app on the App Store.”

We, at InfiniteRed, used this for Temple and it worked well.

RMQ Tips


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

Animations:

rmq provides a standard animate method, that does everything using blocks/lambda . A basic example is:rmq(my_view).animate(
duration: 0.3,
animations: -> (q)
q.move left: 20
}
)

Note, if you’re not familiar -> is the new syntax for a lambda

Duration defaults to 0.3, so that isn’t needed. q.move is another rmq action.

rmq has built in animations, such as fade_in, fade_out, blink, throb, etc:
rmq(my_view).animations.fade_in
rmq(my_view).animations.fade_in(duration: 0.8)

Here is another example, this is how animations.throb is written:

rmq(selectors).animate(
duration: 0.1,
animations: -> (q) {
q.style {|st| st.scale = 1.1}
},
completion: -> (did_finish, q) {
q.animate(
duration: 0.4,
animations: -> (cq) {
cq.style {|st| st.scale = 1.0}
}
)
}
)

This Issue’s Sponsor


MotionInMotion – The New RubyMotion Screencast!

Master building iOS and Mac apps!

Watch episodes about:

  • Building iOS and OS X apps with Ruby
  • Programming your interfaces
  • When Xcode can be helpful
  • Creating stunning animations
  • Zero to TestFlight to Deploy
  • Using Core Data
All episodes will be done using behavior driven development!

One more thing


“After years of iOS work, RubyMotion seems like a thousand kittens playing the piano while sliding down a double-rainbow.”

Johannes Fahrenkrug, Founder, Springenwerk